From 58d04553c7713477b077809a7f062118522665e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 Aug 2012 14:25:16 +0000 Subject: unicode Folders paths git-svn-id: http://svn.miranda-ng.org/main/trunk@1392 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CrashDumper/src/crshdmp.cpp | 1 + plugins/FlashAvatars/src/cflash.cpp | 1 + plugins/MirOTR/MirOTR/options.cpp | 166 ++++++++++++++++++------------------ protocols/IcqOscarJ/icq_avatar.cpp | 39 ++++----- 4 files changed, 105 insertions(+), 102 deletions(-) diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index faaaf2d426..fcaee71f6b 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -186,6 +186,7 @@ static int FoldersPathChanged(WPARAM, LPARAM) fgd.cbSize = sizeof(FOLDERSGETDATA); fgd.nMaxPathSize = MAX_PATH; fgd.szPathT = CrashLogFolder; + fgd.flags = FF_TCHAR; CallService(MS_FOLDERS_GET_PATH, (WPARAM) hCrashLogFolder, (LPARAM) &fgd); fgd.szPathT = VersionInfoFolder; diff --git a/plugins/FlashAvatars/src/cflash.cpp b/plugins/FlashAvatars/src/cflash.cpp index 89bc12cf33..3049d04fff 100644 --- a/plugins/FlashAvatars/src/cflash.cpp +++ b/plugins/FlashAvatars/src/cflash.cpp @@ -199,6 +199,7 @@ static void __cdecl loadFlash_Thread(void *p) { fgd.cbSize = sizeof(FOLDERSGETDATA); fgd.nMaxPathSize = MAX_PATH; fgd.szPathT = path; + fgd.flags = FF_TCHAR; if (!hAvatarsFolder || CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) { if(ServiceExists(MS_UTILS_REPLACEVARS)) { TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%")); diff --git a/plugins/MirOTR/MirOTR/options.cpp b/plugins/MirOTR/MirOTR/options.cpp index 1e4a98f288..d76d6c9bc8 100644 --- a/plugins/MirOTR/MirOTR/options.cpp +++ b/plugins/MirOTR/MirOTR/options.cpp @@ -20,9 +20,9 @@ struct PROTOREGENKEYOPTIONS { void SetFilenames(const char *path) { if (!path || !path[0]) return; CallService(MS_UTILS_CREATEDIRTREE, 0, (LPARAM) path); - strcpy(g_fingerprint_store_filename, path); - strcpy(g_private_key_filename, path); - strcat(g_fingerprint_store_filename, ("\\")); + strcpy(g_fingerprint_store_filename, path); + strcpy(g_private_key_filename, path); + strcat(g_fingerprint_store_filename, ("\\")); strcat(g_private_key_filename, ("\\")); strcat(g_fingerprint_store_filename, FINGERPRINT_STORE_FILENAME); @@ -31,12 +31,12 @@ void SetFilenames(const char *path) { int FoldersChanged(WPARAM wParam, LPARAM lParam) { char path[MAX_PATH]; - + FOLDERSGETDATA fgd = {0}; fgd.cbSize = sizeof(FOLDERSGETDATA); fgd.nMaxPathSize = MAX_PATH; fgd.szPath = path; - + fgd.flags = FF_TCHAR; if (CallService(MS_FOLDERS_GET_PATH, (LPARAM)hPATH_MIROTR, (LPARAM)&fgd)) { char *mypath = Utils_ReplaceVars(DATA_DIRECTORY); SetFilenames(mypath); @@ -52,7 +52,7 @@ void LoadFilenames() { if(ServiceExists(MS_FOLDERS_REGISTER_PATH)) { hPATH_MIROTR = FoldersRegisterCustomPath(MODULENAME, "Private Data", DATA_DIRECTORY); HookEvent(ME_FOLDERS_PATH_CHANGED, FoldersChanged); - + // get the path - above are only defaults - there may be a different value in the db FoldersChanged(0, 0); } else { @@ -86,7 +86,7 @@ void LoadOptions() { options.delete_history = (DBGetContactSettingByte(0, MODULENAME, "NoHistory", 0) == 1); options.delete_systeminfo = (DBGetContactSettingByte(0, MODULENAME, "NoSystemHistory", 0) == 1); options.autoshow_verify = (DBGetContactSettingByte(0, MODULENAME, "AutoShowVerify", 1) == 1); - + DBVARIANT dbv; if (!DBGetContactSettingUTF8String(0, MODULENAME, "Prefix", &dbv)) { strncpy(options.prefix, dbv.pszVal, OPTIONS_PREFIXLEN); @@ -96,7 +96,7 @@ void LoadOptions() { strcpy(options.prefix, ("OTR: ")); options.timeout_finished = (DBGetContactSettingByte(0, MODULENAME, "TimeoutFinished", 0) == 1); - + options.end_offline = (DBGetContactSettingByte(0, MODULENAME, "EndOffline", 1) == 1); options.end_window_close = (DBGetContactSettingByte(0, MODULENAME, "EndWindowClose", 0) == 1); @@ -105,14 +105,14 @@ void LoadOptions() { options.bHaveSRMMIcons = 0!=ServiceExists(MS_MSG_MODIFYICON); options.bHaveSecureIM = 0!=ServiceExists("SecureIM/IsContactSecured"); options.bHaveButtonsBar = 0!=ServiceExists(MS_BB_ADDBUTTON); - + LoadFilenames(); } extern "C" int OpenOptions(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; - + odp.cbSize = sizeof(odp); odp.position = 100; odp.hInstance = hInst; @@ -134,7 +134,7 @@ extern "C" int OpenOptions(WPARAM wParam, LPARAM lParam) odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS); odp.pfnDlgProc = DlgProcMirOTROptsContacts; Options_AddPage(wParam, &odp); - + odp.ptszTab = _T(LANG_OPT_FINGER); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FINGER); odp.pfnDlgProc = DlgProcMirOTROptsFinger; @@ -170,8 +170,8 @@ void SaveOptions() { } } */ - - DBWriteContactSettingStringUtf(0, MODULENAME, "Prefix", options.prefix); + + DBWriteContactSettingStringUtf(0, MODULENAME, "Prefix", options.prefix); DBWriteContactSettingByte(0, MODULENAME, "TimeoutFinished", options.timeout_finished ? 1 : 0); @@ -196,9 +196,9 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, { TCHAR *prefix; char* prefix_utf; switch ( msg ) { - case WM_INITDIALOG: + case WM_INITDIALOG: TranslateDialogDefault( hwndDlg ); - + // set default policy radio switch(options.default_policy) { case OTRL_POLICY_OPPORTUNISTIC: @@ -224,7 +224,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, CheckDlgButton(hwndDlg, IDC_CHK_AUTOSHOW_VERIFY, options.autoshow_verify ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_ENDOFFLINE, options.end_offline ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_ENDCLOSE, options.end_window_close ? TRUE : FALSE); - + prefix = mir_utf8decodeT(options.prefix); SetDlgItemText(hwndDlg, IDC_ED_PREFIX, prefix); mir_free(prefix); @@ -232,10 +232,10 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, return TRUE; break; - case WM_COMMAND: + case WM_COMMAND: switch ( HIWORD( wParam )) { - case BN_CLICKED: - switch ( LOWORD( wParam )) { + case BN_CLICKED: + switch ( LOWORD( wParam )) { case IDC_RAD_OPP: case IDC_RAD_MANUAL: case IDC_RAD_ALWAYS: @@ -258,7 +258,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, } break; - case WM_NOTIFY: + case WM_NOTIFY: if (((LPNMHDR)lParam)->code == (UINT) PSN_APPLY ) { // handle apply @@ -269,7 +269,7 @@ static INT_PTR CALLBACK DlgProcMirOTROpts(HWND hwndDlg, UINT msg, WPARAM wParam, options.default_policy = OTRL_POLICY_MANUAL_MOD; else if (IsDlgButtonChecked(hwndDlg, IDC_RAD_ALWAYS)) options.default_policy = OTRL_POLICY_ALWAYS; - else + else options.default_policy = OTRL_POLICY_NEVER; options.prefix_messages = (TRUE==IsDlgButtonChecked(hwndDlg, IDC_CHK_PREFIX)); @@ -306,7 +306,7 @@ static unsigned int CALLBACK regen_key_thread(void* param) TCHAR *buff = (TCHAR*) mir_alloc(512*sizeof(TCHAR)); mir_sntprintf(buff, 512, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto); EnableWindow(opts->refresh, FALSE); - if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) + if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) { mir_free(buff); @@ -335,7 +335,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP { HWND lv; switch ( msg ) { - case WM_INITDIALOG: + case WM_INITDIALOG: TranslateDialogDefault( hwndDlg ); lv = GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS); @@ -355,25 +355,25 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP SendMessage(lv,LVM_SETEXTENDEDLISTVIEWSTYLE, 0,LVS_EX_FULLROWSELECT);// | LVS_EX_CHECKBOXES); { // add list columns - LVCOLUMN lvc; + LVCOLUMN lvc; // Initialize the LVCOLUMN structure. // The mask specifies that the format, width, text, and - // subitem members of the structure are valid. - lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; + // subitem members of the structure are valid. + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateT(LANG_PROTO); lvc.cx = 85; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); - + lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_POLICY); + lvc.pszText = TranslateT(LANG_POLICY); lvc.cx = 80; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_FINGERPRINT); + lvc.pszText = TranslateT(LANG_FINGERPRINT); lvc.cx = 275; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); } @@ -403,24 +403,24 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP item.pszText = temp; ilvItem = ListView_InsertItem(lv, &item); mir_free(temp); - + ListView_SetItemText(lv, ilvItem, 1, (TCHAR*)policy_to_string(db_dword_get(0,MODULENAME"_ProtoPol", pppDesc[i]->szName, CONTACT_DEFAULT_POLICY)) ); if(otrl_privkey_fingerprint(otr_user_state, fprint, pppDesc[i]->szName, pppDesc[i]->szName)) { temp = mir_a2t(fprint); ListView_SetItemText(lv, ilvItem, 2, temp); mir_free(temp); - } + } } } } return TRUE; - case WM_COMMAND: + case WM_COMMAND: switch ( HIWORD( wParam )) { - case BN_CLICKED: - switch ( LOWORD( wParam )) { + case BN_CLICKED: + switch ( LOWORD( wParam )) { case IDC_BTN_PROTO_NEWKEY: - { + { int sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS)); if (sel != -1) { PROTOREGENKEYOPTIONS *opts = new PROTOREGENKEYOPTIONS(); @@ -430,14 +430,14 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP } }break; case IDC_BTN_PROTO_FORGET: - { + { int sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS)); if (sel != -1) { TCHAR buff_proto[128]; ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, 128); TCHAR buff[512]; mir_sntprintf(buff, 512, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto); - if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) + if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) { char* proto = mir_t2a(buff_proto); OtrlPrivKey *key = otrl_privkey_find(otr_user_state, proto, proto); @@ -452,9 +452,9 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP }break; } case CBN_SELCHANGE: - switch ( LOWORD( wParam )) { + switch ( LOWORD( wParam )) { case IDC_CMB_PROTO_POLICY: - { + { int proto = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS)); if (proto == -1) break; int sel = SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_GETCURSEL, 0, 0); @@ -472,7 +472,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP } break; - case WM_NOTIFY: + case WM_NOTIFY: if (((LPNMHDR) lParam)->code == (UINT) LVN_ITEMCHANGED && ((LPNMHDR) lParam)->hwndFrom == GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS) && (((LPNMLISTVIEW)lParam)->uNewState & LVIS_SELECTED )) { int sel = ListView_GetSelectionMark(((LPNMHDR) lParam)->hwndFrom); @@ -513,7 +513,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch ( msg ) { - case WM_INITDIALOG: + case WM_INITDIALOG: { TranslateDialogDefault( hwndDlg ); @@ -531,33 +531,33 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM HWND lv = GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS); - - + + // add list columns - LVCOLUMN lvc; + LVCOLUMN lvc; // Initialize the LVCOLUMN structure. // The mask specifies that the format, width, text, and - // subitem members of the structure are valid. - lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; + // subitem members of the structure are valid. + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_CONTACT); + lvc.pszText = TranslateT(LANG_CONTACT); lvc.cx = 150; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); - + lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateT(LANG_PROTO); lvc.cx = 100; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_POLICY); + lvc.pszText = TranslateT(LANG_POLICY); lvc.cx = 90; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); lvc.iSubItem = 3; - lvc.pszText = TranslateT(LANG_HTMLCONV); + lvc.pszText = TranslateT(LANG_HTMLCONV); lvc.cx = 80; // width of column in pixels ListView_InsertColumn(lv, 3, &lvc); } @@ -574,8 +574,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM // Some code to create the list-view control. // Initialize LVITEM members that are common to all - // items. - lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; + // items. + lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; const char *proto; TCHAR *proto_t; @@ -600,18 +600,18 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM ListView_SetItemText(lv, lvI.iItem, 3, (db_byte_get(hContact, MODULENAME, "HTMLConv", 0))?TranslateT(LANG_YES):TranslateT(LANG_NO) ); } - + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 ); } } return TRUE; break; - case WM_COMMAND: + case WM_COMMAND: switch ( HIWORD( wParam )) { case CBN_SELCHANGE: - switch ( LOWORD( wParam )) { + switch ( LOWORD( wParam )) { case IDC_CMB_CONT_POLICY: - { + { HANDLE hContact = 0; int iUser = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_CONT_CONTACTS)); if (iUser == -1) break; @@ -639,7 +639,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM } break; - case WM_NOTIFY: + case WM_NOTIFY: { UINT code = ((LPNMHDR) lParam)->code; if (code == (UINT) PSN_APPLY ) { @@ -690,8 +690,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM (*cp)[hContact].htmlconv += 1; SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } - - + + } } }break; @@ -707,7 +707,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch ( msg ) { - case WM_INITDIALOG: + case WM_INITDIALOG: TranslateDialogDefault( hwndDlg ); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (ULONG_PTR) new FPModifyMap()); @@ -716,42 +716,42 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w { HWND lv = GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST); // add list columns - LVCOLUMN lvc; + LVCOLUMN lvc; // Initialize the LVCOLUMN structure. // The mask specifies that the format, width, text, and - // subitem members of the structure are valid. - lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; + // subitem members of the structure are valid. + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = LVCFMT_LEFT; lvc.iSubItem = 0; - lvc.pszText = TranslateT(LANG_CONTACT); + lvc.pszText = TranslateT(LANG_CONTACT); lvc.cx = 100; // width of column in pixels ListView_InsertColumn(lv, 0, &lvc); - + lvc.iSubItem = 1; - lvc.pszText = TranslateT(LANG_PROTO); + lvc.pszText = TranslateT(LANG_PROTO); lvc.cx = 90; // width of column in pixels ListView_InsertColumn(lv, 1, &lvc); lvc.iSubItem = 2; - lvc.pszText = TranslateT(LANG_ACTIVE); + lvc.pszText = TranslateT(LANG_ACTIVE); lvc.cx = 50; // width of column in pixels ListView_InsertColumn(lv, 2, &lvc); lvc.iSubItem = 3; - lvc.pszText = TranslateT(LANG_VERIFIED); + lvc.pszText = TranslateT(LANG_VERIFIED); lvc.cx = 50; // width of column in pixels ListView_InsertColumn(lv, 3, &lvc); lvc.iSubItem = 4; - lvc.pszText = TranslateT(LANG_FINGERPRINT); + lvc.pszText = TranslateT(LANG_FINGERPRINT); lvc.cx = 300; // width of column in pixels ListView_InsertColumn(lv, 4, &lvc); } SendMessage(hwndDlg, WMU_REFRESHLIST, 0, 0); return TRUE; - + case WMU_REFRESHLIST: //enumerate contacts, fill in list { @@ -762,8 +762,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w // Some code to create the list-view control. // Initialize LVITEM members that are common to all - // items. - lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; + // items. + lvI.mask = LVIF_TEXT | LVIF_PARAM;// | LVIF_NORECOMPUTE;// | LVIF_IMAGE; ConnContext * context = otr_user_state->context_root; TCHAR *proto, *user, hash[45] = {0}; Fingerprint *fp; @@ -796,12 +796,12 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w } return TRUE; - case WM_COMMAND: + case WM_COMMAND: switch ( HIWORD( wParam )) { - case BN_CLICKED: - switch ( LOWORD( wParam )) { + case BN_CLICKED: + switch ( LOWORD( wParam )) { case IDC_BTN_FINGER_DONTTRUST: - { + { int sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST)); if (sel != -1) { LVITEM lvi = {0}; @@ -817,7 +817,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w } }break; case IDC_BTN_FINGER_TRUST: - { + { int sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST)); if (sel != -1) { LVITEM lvi = {0}; @@ -833,7 +833,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w } }break; case IDC_BTN_FINGER_FORGET: - { + { int sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_FINGER_LIST)); if (sel != -1) { LVITEM lvi = {0}; @@ -859,7 +859,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w } break; - case WM_NOTIFY: + case WM_NOTIFY: if (((LPNMHDR)lParam)->code == (UINT) PSN_APPLY ) { // handle apply @@ -882,13 +882,13 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w break; case FPM_VERIFY: otrl_context_set_trust(it->first, "verified"); - if (it->first == it->first->context->active_fingerprint) + if (it->first == it->first->context->active_fingerprint) VerifyFingerprint(it->first->context, true); //SetEncryptionStatus((HANDLE)it->first->context->app_data, otr_context_get_trust(it->first->context)); break; case FPM_NOTRUST: otrl_context_set_trust(it->first, NULL); - if (it->first == it->first->context->active_fingerprint) + if (it->first == it->first->context->active_fingerprint) VerifyFingerprint(it->first->context, false); //SetEncryptionStatus((HANDLE)it->first->context->app_data, otr_context_get_trust(it->first->context)); break; diff --git a/protocols/IcqOscarJ/icq_avatar.cpp b/protocols/IcqOscarJ/icq_avatar.cpp index 29a92ec4a4..570a1bc440 100644 --- a/protocols/IcqOscarJ/icq_avatar.cpp +++ b/protocols/IcqOscarJ/icq_avatar.cpp @@ -1,22 +1,22 @@ // ---------------------------------------------------------------------------80 // ICQ plugin for Miranda Instant Messenger // ________________________________________ -// +// // Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede // Copyright © 2001-2002 Jon Keating, Richard Hughes // Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater // Copyright © 2004-2010 Joe Kucera -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -135,6 +135,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, fgd.cbSize = sizeof(FOLDERSGETDATA); fgd.nMaxPathSize = MAX_PATH * 2; fgd.szPathT = szPath; + fgd.flags = FF_TCHAR; if (CallService(MS_FOLDERS_GET_PATH, (WPARAM)hAvatarsFolder, (LPARAM)&fgd)) { TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_avatarcache%")); @@ -143,7 +144,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, } else _tcscat(szPath, _T("\\")); - + // fill the destination lstrcpyn(pszDest, szPath, cbLen - 1); int tPathLen = strlennull(pszDest); @@ -151,7 +152,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, // make sure the avatar cache directory exists CallService(MS_UTILS_CREATEDIRTREET, 0, (LPARAM)szPath); - if (dwUin != 0) + if (dwUin != 0) { _ltot(dwUin, pszDest + tPathLen, 10); } @@ -167,7 +168,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, if (CallService(MS_DB_GETPROFILENAMET, MAX_PATH, (LPARAM)szBuf)) _tcscpy(pszDest + tPathLen, _T("avatar")); - else + else { TCHAR *szLastDot = _tcsrchr(szBuf, '.'); if (szLastDot) szLastDot[0] = '\0'; @@ -545,7 +546,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac BYTE itemFlags = pHash[2]; // just some validity check - if (itemLen + 4 > nHashLen) + if (itemLen + 4 > nHashLen) itemLen = nHashLen - 4; if (itemLen && memcmp(pHash + 4, emptyItem, itemLen > 0x10 ? 0x10 : itemLen)) @@ -775,7 +776,7 @@ int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, co { uid_str szUidData; char *pszUid = NULL; - if (!dwUin && szUid) + if (!dwUin && szUid) { // create a copy in local writable buffer strcpy(szUidData, szUid); pszUid = szUidData; @@ -879,7 +880,7 @@ int CIcqProto::GetAvatarData(HANDLE hContact, DWORD dwUin, const char *szUid, co // upload avatar data to server int CIcqProto::SetAvatarData(HANDLE hContact, WORD wRef, const BYTE *data, unsigned int datalen) -{ +{ m_avatarsMutex->Enter(); if (m_avatarsConnection && m_avatarsConnection->isReady()) // check if we are ready @@ -987,7 +988,7 @@ void __cdecl CIcqProto::AvatarThread(avatars_server_connection *pInfo) } -avatars_server_connection::avatars_server_connection(CIcqProto *ppro, HANDLE hConnection, char *pCookie, WORD wCookieLen): +avatars_server_connection::avatars_server_connection(CIcqProto *ppro, HANDLE hConnection, char *pCookie, WORD wCookieLen): isLoggedIn(FALSE), stopThread(FALSE), isActive(FALSE) { this->ppro = ppro; @@ -1294,14 +1295,14 @@ void avatars_server_connection::connectionThread() #endif SleepEx(500, TRUE); // wait some time, can we do anything else ?? if (Miranda_Terminated()) - { + { stopThread = 1; continue; } } // check if we got something to request checkRequestQueue(); - continue; + continue; } if (!stopThread) NetLog_Server("Abortive closure of server socket, error: %d", GetLastError()); @@ -1320,7 +1321,7 @@ void avatars_server_connection::connectionThread() } { // release connection icq_lock l(localSeqMutex); - NetLib_SafeCloseHandle(&hPacketRecver); // Close the packet receiver + NetLib_SafeCloseHandle(&hPacketRecver); // Close the packet receiver NetLib_CloseConnection(&hConnection, FALSE); // Close the connection } @@ -1449,7 +1450,7 @@ void avatars_server_connection::handleLoginChannel(BYTE *buf, WORD datalen) if (*(DWORD*)buf == 0x1000000) { // here check if we received SRV_HELLO - wLocalSequence = generate_flap_sequence(); + wLocalSequence = generate_flap_sequence(); serverCookieInit(&packet, (LPBYTE)pCookie, wCookieLen); sendServerPacket(&packet); @@ -1603,7 +1604,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt ai.format = PA_FORMAT_JPEG; // this is for error only ai.hContact = pCookieData->hContact; lstrcpyn(ai.filename, pCookieData->szFile, SIZEOF(ai.filename)); - AddAvatarExt(PA_FORMAT_JPEG, ai.filename); + AddAvatarExt(PA_FORMAT_JPEG, ai.filename); ppro->FreeCookie(pSnacHeader->dwRef); @@ -1668,7 +1669,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt lstrcpyn(ai.filename, tszImageFile, SIZEOF(ai.filename)); int out = _topen(tszImageFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE); - if (out != -1) + if (out != -1) { DBVARIANT dbv = {DBVT_DELETED}; @@ -1703,7 +1704,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt } ppro->BroadcastAck(pCookieData->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, (HANDLE)&ai, 0); - } + } } else { // avatar is broken @@ -1801,7 +1802,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt if (wBufferLength >= 2) unpackWord(&pBuffer, &wError); - else + else wError = 0; ppro->LogFamilyError(ICQ_AVATAR_FAMILY, wError); -- cgit v1.2.3