diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-19 19:23:46 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-19 19:24:17 +0300 |
commit | 15aed01c9736ea9b33d41ee9bbc72c1be1fc4f74 (patch) | |
tree | 2a680411c13873cf8ee24b4cadee5f58fa64ec44 /plugins/New_GPG/src/messages.cpp | |
parent | 6f71bc1011872b66aed16516b7e8944085058a11 (diff) |
New_GPG -> TinyXml2
Diffstat (limited to 'plugins/New_GPG/src/messages.cpp')
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index f512e57b11..ea21d69520 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -557,27 +557,26 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) } else if (!isContactHaveKey(ccs->hContact) && globals.bAutoExchange && globals.gpg_valid && globals.gpg_keyexist) { char *proto = GetContactProto(ccs->hContact); - wchar_t *jid = db_get_wsa(ccs->hContact, proto, "jid", L""); + ptrA jid(db_get_utfa(ccs->hContact, proto, "jid", "")); if (jid[0]) { for (auto p : globals.Accounts) { - wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); + ptrA caps(p->getJabberInterface()->GetResourceFeatures(jid)); if (caps) { - wstring str1; + string str1; for (int i = 0;; i++) { str1.push_back(caps[i]); if (caps[i] == '\0') if (caps[i + 1] == '\0') break; } - mir_free(caps); - if (str1.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { + + if (str1.find("GPG_Key_Auto_Exchange:0") != string::npos) { ProtoChainSend(ccs->hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); return 0; } } } } - mir_free(jid); } if (!strstr(msg, "-----BEGIN PGP MESSAGE-----")) @@ -845,22 +844,22 @@ int HookSendMsg(WPARAM w, LPARAM l) globals.debuglog << std::string(time_str() + ": info: checking for autoexchange possibility, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); LPSTR proto = GetContactProto(hContact); - wchar_t *jid = db_get_wsa(hContact, proto, "jid", L""); + ptrA jid(db_get_utfa(hContact, proto, "jid", "")); if (jid[0]) { if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); for (auto p : globals.Accounts) { - wchar_t *caps = p->getJabberInterface()->GetResourceFeatures(jid); + ptrA caps(p->getJabberInterface()->GetResourceFeatures(jid)); if (caps) { - wstring str; + string str; for (int i = 0;; i++) { str.push_back(caps[i]); if (caps[i] == '\0') if (caps[i + 1] == '\0') break; } - mir_free(caps); - if (str.find(L"GPG_Key_Auto_Exchange:0") != string::npos) { + + if (str.find("GPG_Key_Auto_Exchange:0") != string::npos) { if (globals.bDebugLog) globals.debuglog << std::string(time_str() + ": info(autoexchange, jabber): autoexchange capability found, sending key request, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); @@ -871,7 +870,6 @@ int HookSendMsg(WPARAM w, LPARAM l) } } } - mir_free(jid); } else return 0; } |