diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2012-10-11 00:26:17 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2012-10-11 00:26:17 +0000 |
commit | 3c674975575148431f62b0db6ac20b55bccf21f0 (patch) | |
tree | 6c09f69f2516fd3637e22639335ea45b7ec04c44 /plugins/New_GPG | |
parent | 5d54a1ba8bad01c4b4d22ee12ab8fe0adf9d9027 (diff) |
fixed sendkey
git-svn-id: http://svn.miranda-ng.org/main/trunk@1869 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index e2841d6c85..652b383cc8 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -147,7 +147,7 @@ INT_PTR SendKey(WPARAM w, LPARAM l) char *szMessage; { LPSTR proto = (LPSTR)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETCONTACTBASEPROTO, 0, (LPARAM)proto); + PROTOACCOUNT *acc = (PROTOACCOUNT*)CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)proto); std::string acc_str; if(acc) { @@ -157,7 +157,12 @@ INT_PTR SendKey(WPARAM w, LPARAM l) acc_str += ")" ; acc_str += "_GPGPubKey"; } - szMessage = UniGetContactSettingUtf(hContact, szGPGModuleName, acc_str.empty()?"GPGPubKey":acc_str.c_str(), ""); + szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, acc_str.empty()?"GPGPubKey":acc_str.c_str(), ""); + if(!szMessage[0]) + { + mir_free(szMessage); + szMessage = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", ""); //try to get default key as fallback in any way + } } if(szMessage[0]) { |