diff options
Diffstat (limited to 'utilities.cpp')
-rwxr-xr-x | utilities.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/utilities.cpp b/utilities.cpp index e071aaf..54cee7a 100755 --- a/utilities.cpp +++ b/utilities.cpp @@ -197,19 +197,18 @@ int SendKey(WPARAM w, LPARAM l) hContact = metaGetMostOnline(hContact); char *szMessage; { - char *proto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - char setting[64]; - if(proto) + LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETCONTACTBASEPROTO, 0, (LPARAM)proto); + std::string acc_str; + if(acc) { - strcpy(setting, proto); - strcat(setting, "_GPGPubKey"); - szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, setting, ""); - } - if(!szMessage[0]) - { - mir_free(szMessage); - szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); + acc_str = toUTF8(acc->tszAccountName); + acc_str += "("; + acc_str += acc->szModuleName; + acc_str += ")" ; + acc_str += "_GPGPubKey"; } + char *szMessage = UniGetContactSettingUtf(hContact, szGPGModuleName, acc_str.empty()?"GPGPubKey":acc_str.c_str(), ""); } if(szMessage[0]) { @@ -1199,7 +1198,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 = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + ack.szModule = szGPGModuleName;// (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); ack.hContact = hContact; ack.type = type; ack.result = result; |