From 5735d6a9ee7c250bd563529a3226174efe74ba38 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 22 Dec 2012 08:54:19 +0200 Subject: merged with mirnada ng main repo --- src/utilities.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/utilities.cpp') diff --git a/src/utilities.cpp b/src/utilities.cpp index a734ec0..3f25394 100755 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -195,7 +195,7 @@ INT_PTR SendKey(WPARAM w, LPARAM l) hContact = metaGetMostOnline(hContact); char *szMessage; { - LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + LPSTR proto = GetContactProto(hContact); PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); std::string acc_str; if(acc) @@ -257,8 +257,8 @@ INT_PTR ToggleEncryption(WPARAM w, LPARAM l) setSrmmIcon(hContact); setClistIcon(hContact); enc = enc?0:1; - CLISTMENUITEM mi = {0}; - mi.cbSize=sizeof(mi); + + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_NAME; enc?mi.pszName="Turn off GPG encryption":mi.pszName="Turn on GPG encryption"; CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hToggleEncryption, (LPARAM)&mi); @@ -270,8 +270,8 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) HANDLE hContact = (HANDLE)w; if(metaIsProtoMetaContacts(hContact)) hContact = metaGetMostOnline(hContact); - CLISTMENUITEM mi = {0}; - mi.cbSize=sizeof(mi); + + CLISTMENUITEM mi = { sizeof(mi) }; mi.flags = CMIM_NAME; TCHAR *tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); if(_tcslen(tmp) < 1) @@ -321,6 +321,7 @@ int onProtoAck(WPARAM w, LPARAM l) } if(_tcsstr(filename, _T(".gpg"))) //decrypt it { //process encrypted file + HistoryLog(ack->hContact, db_event("Recieved encrypted file, trying to decrypt", 0,0, 0)); if(_waccess(f->tszCurrentFile, 0) == -1) { if(errno == ENOENT) @@ -567,7 +568,7 @@ int onSendFile(WPARAM w, LPARAM l) CCSDATA *ccs=(CCSDATA*)l; if(isContactSecured(ccs->hContact)) { - + HistoryLog(ccs->hContact, db_event(Translate("encrypting file for transfer"), 0, 0, DBEF_SENT)); DWORD flags = (DWORD)ccs->wParam; //check for PFTS_UNICODE here int i; // if(flags & PFTS_UNICODE) //this does not work .... @@ -1214,7 +1215,7 @@ int SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARA ACKDATA ack; memset(&ack,0,sizeof(ack)); ack.cbSize = sizeof( ACKDATA ); - ack.szModule = szGPGModuleName;// (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + ack.szModule = szGPGModuleName;// GetContactProto(hContact); ack.hContact = hContact; ack.type = type; ack.result = result; @@ -1251,6 +1252,7 @@ int returnNoError(HANDLE hContact) { return 777; } // end from secureim + string toUTF8(wstring str) @@ -1347,7 +1349,7 @@ bool isTabsrmmUsed() enm.lParam = (LPARAM)&found; enm.pfnEnumProc = (DBSETTINGENUMPROC)&handleEnum; enm.szModule = "PluginDisable"; - if(CallService(MS_DB_CONTACT_ENUMSETTINGS, (WPARAM)NULL, (LPARAM)&enm) == -1) + if(CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&enm) == -1) return false; return found; @@ -1382,7 +1384,7 @@ INT_PTR ExportGpGKeys(WPARAM w, LPARAM l) std::string key = k; mir_free(k); - const char* proto = (const char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + const char* proto = (const char*)GetContactProto(hContact); std::string id = "Comment: login "; const char * uid = (const char*)CallProtoService(proto, PS_GETCAPS, (WPARAM)PFLAG_UNIQUEIDSETTING, 0); DBVARIANT dbv = {0}; -- cgit v1.2.3