From bd8a04455d9c991c15df2287e091abe4ba054efb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 25 Nov 2012 12:54:45 +0000 Subject: typed stub for MS_PROTO_GETCONTACTBASEPROTO git-svn-id: http://svn.miranda-ng.org/main/trunk@2480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/messages.cpp | 10 ++++------ plugins/New_GPG/src/metacontacts.cpp | 2 +- plugins/New_GPG/src/options.cpp | 2 +- plugins/New_GPG/src/utilities.cpp | 6 +++--- 4 files changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index abc1a624ec..db17333da6 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -568,11 +568,9 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } else if(!isContactHaveKey(ccs->hContact) && bAutoExchange && gpg_valid && gpg_keyexist) { - LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0); + char *proto = GetContactProto(ccs->hContact); DWORD uin = DBGetContactSettingDword(ccs->hContact, proto, "UIN", 0); - if(uin) - { - char *proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0); + if(uin) { char svc[64]; strcpy(svc, proto); strcat(svc, PS_ICQ_CHECKCAPABILITY); @@ -841,11 +839,11 @@ int SendMsgSvc(WPARAM w, LPARAM l) if(bAutoExchange && !strstr(msg, "-----PGP KEY REQUEST-----") && !strstr(msg, "-----BEGIN PGP PUBLIC KEY BLOCK-----") && gpg_valid) { void send_encrypted_msgs_thread(HANDLE hContact); - LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0); + LPSTR proto = GetContactProto(ccs->hContact); DWORD uin = DBGetContactSettingDword(ccs->hContact, proto, "UIN", 0); if(uin) { - char *proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0); + char *proto = GetContactProto(ccs->hContact); char svc[64]; strcpy(svc, proto); strcat(svc, PS_ICQ_CHECKCAPABILITY); diff --git a/plugins/New_GPG/src/metacontacts.cpp b/plugins/New_GPG/src/metacontacts.cpp index 1abc2aaeac..ab3c60bce5 100755 --- a/plugins/New_GPG/src/metacontacts.cpp +++ b/plugins/New_GPG/src/metacontacts.cpp @@ -21,7 +21,7 @@ extern bool bMetaContacts; bool metaIsProtoMetaContacts(HANDLE hContact) { if(bMetaContacts) { - LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + LPSTR proto = GetContactProto(hContact); if( proto && strcmp(proto,"MetaContacts")==0 ) { return true; } diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index add9e9566c..8b9f32d58c 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -156,7 +156,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP item.pszText = name; iRow = ListView_InsertItem(hwndList, &item); ListView_SetItemText(hwndList, iRow, 0, name); - TCHAR *tmp = mir_a2t((char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)); + TCHAR *tmp = mir_a2t(GetContactProto(hContact)); ListView_SetItemText(hwndList, iRow, 4, tmp); mir_free(tmp); tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", ""); diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index f0a8e7a387..f872bd5e7f 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -146,7 +146,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) @@ -1165,7 +1165,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; @@ -1334,7 +1334,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