summaryrefslogtreecommitdiff
path: root/src/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-06 20:26:50 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-06 20:26:50 +0300
commit418526a0e2c4a00afae9f9d2678be7c837c247d0 (patch)
treebc1ffc78a68e6b2321c884b26e5859f2db2e5a92 /src/utilities.cpp
parent4b685bb64d79b8592dd2f8e3ccfb49f67e2947f3 (diff)
logic fixes
Diffstat (limited to 'src/utilities.cpp')
-rwxr-xr-xsrc/utilities.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/utilities.cpp b/src/utilities.cpp
index 162b541..54cee7a 100755
--- a/src/utilities.cpp
+++ b/src/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])
{