summaryrefslogtreecommitdiff
path: root/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-11 01:33:53 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2012-09-11 01:33:53 +0300
commitdf91299c0082a489e3a45f06b1cb52f2162b883d (patch)
tree45ca826f58126f43c7563b4a4e5880d2b67818c7 /utilities.cpp
parent5631c9efc283f72fdaf4eb3ed6212b0d3dee8d7f (diff)
ported changes from miranda_ng branch
Diffstat (limited to 'utilities.cpp')
-rwxr-xr-xutilities.cpp23
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;