diff options
Diffstat (limited to 'plugins/New_GPG')
-rwxr-xr-x | plugins/New_GPG/src/init.cpp | 3 | ||||
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 66 | ||||
-rwxr-xr-x | plugins/New_GPG/src/options.cpp | 6 | ||||
-rwxr-xr-x | plugins/New_GPG/src/ui.cpp | 2 | ||||
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 18 |
5 files changed, 46 insertions, 49 deletions
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 1aec1f4c5f..e83731181b 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -17,10 +17,8 @@ #include "stdafx.h" //global variables -CLIST_INTERFACE *pcli; int hLangpack = 0; - PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -154,7 +152,6 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load() { mir_getLP(&pluginInfo); - pcli = Clist_GetInterface(); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 23be122459..d4086b8f1a 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -32,7 +32,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR if (!isContactSecured(hContact)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: received encrypted message from: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " with turned off encryption"); + globals.debuglog << std::string(time_str() + ": info: received encrypted message from: " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with turned off encryption"); if (MessageBox(nullptr, TranslateT("We received encrypted message from contact with encryption turned off.\nDo you want to turn on encryption for this contact?"), TranslateT("Warning"), MB_YESNO) == IDYES) { if (!isContactHaveKey(hContact)) @@ -62,7 +62,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR } } else if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: received encrypted message from: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: received encrypted message from: " + toUTF8(Clist_GetContactDisplayName(hContact))); boost::algorithm::erase_all(str, "\r"); s2 += mir_wstrlen(L"-----END PGP MESSAGE-----"); @@ -114,13 +114,13 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR dbsetting += "_Password"; pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); if (pass[0] && globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid + ", trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + inkeyid + ", trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with password"); } else { pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); if (pass[0] && globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with password"); } if (pass && pass[0]) { cmd.push_back(L"--passphrase"); @@ -129,12 +129,12 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR else if (globals.password && globals.password[0]) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with password"); cmd.push_back(L"--passphrase"); cmd.push_back(globals.password); } else if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: passwords not found in database or memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " with out password"); + globals.debuglog << std::string(time_str() + ": info: passwords not found in database or memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " with out password"); mir_free(pass); mir_free(inkeyid); } @@ -199,7 +199,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR while (out.find("public key decryption failed: bad passphrase") != string::npos) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: failed to decrypt messaage from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " password needed, trying to get one"); + globals.debuglog << std::string(time_str() + ": info: failed to decrypt messaage from " + toUTF8(Clist_GetContactDisplayName(hContact)) + " password needed, trying to get one"); if (globals._terminate) { BYTE enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); db_set_b(hContact, szGPGModuleName, "GPGEncryption", 0); @@ -221,7 +221,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD, DWOR if (globals.password) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(hContact))); std::vector<wstring> tmp3; tmp3.push_back(L"--passphrase"); tmp3.push_back(globals.password); @@ -396,7 +396,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) else { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: blocked pgp message to metacontact:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: blocked pgp message to metacontact:" + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); return 0; } } @@ -405,13 +405,13 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if (globals.bAutoExchange && (str.find(L"-----PGP KEY RESPONSE-----") != wstring::npos)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): parsing key response:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange): parsing key response:" + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); s2 = str.find(L"-----END PGP PUBLIC KEY BLOCK-----"); s1 = str.find(L"-----BEGIN PGP PUBLIC KEY BLOCK-----"); if (s1 != wstring::npos && s2 != wstring::npos) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); db_set_ws(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str()); { //gpg execute block @@ -553,7 +553,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) if ((s2 != wstring::npos) && (s1 != wstring::npos)) { //this is public key if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: received key from: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: received key from: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); s1 = 0; while ((s1 = str.find(L"\r", s1)) != wstring::npos) str.erase(s1, 1); @@ -561,15 +561,15 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----"); else if (((s2 = str.find(L"-----BEGIN PGP PRIVATE KEY BLOCK-----")) != wstring::npos) && ((s1 = str.find(L"-----END PGP PRIVATE KEY BLOCK-----")) != wstring::npos)) s2 += mir_wstrlen(L"-----END PGP PRIVATE KEY BLOCK-----"); - CDlgNewKey *d = new CDlgNewKey(ccs->hContact, str.substr(s1, s2 - s1));
- d->Show();
+ CDlgNewKey *d = new CDlgNewKey(ccs->hContact, str.substr(s1, s2 - s1)); + d->Show(); HistoryLog(ccs->hContact, db_event(msg, 0, 0, dbflags)); return 0; } if (globals.bAutoExchange && strstr(msg, "-----PGP KEY REQUEST-----") && globals.gpg_valid && globals.gpg_keyexist) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): received key request from: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange): received key request from: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); ptrA tmp(UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "")); if (tmp[0]) { @@ -644,7 +644,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) wstring str = toUTF16(msg); if (globals.bStripTags && globals.bAppendTags) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: stripping tags in outgoing message, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: stripping tags in outgoing message, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); strip_tags(str); } /* for(std::wstring::size_type i = str.find(L"\r\n"); i != std::wstring::npos; i = str.find(L"\r\n", i+1)) @@ -828,7 +828,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) } if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": adding event to contact: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " on send message."); + globals.debuglog << std::string(time_str() + ": adding event to contact: " + toUTF8(Clist_GetContactDisplayName(hContact)) + " on send message."); fix_line_term(str); sent_msgs.push_back((HANDLE)ProtoChainSend(hContact, PSS_MESSAGE, flags, (LPARAM)toUTF8(str).c_str())); @@ -844,21 +844,21 @@ INT_PTR SendMsgSvc(WPARAM w, LPARAM l) char *msg = (char*)ccs->lParam; if (!msg) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: failed to get message data, name: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: failed to get message data, name: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); return Proto_ChainSend(w, ccs); } if (strstr(msg, "-----BEGIN PGP MESSAGE-----")) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: encrypted messge, let it go, name: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: encrypted messge, let it go, name: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); return Proto_ChainSend(w, ccs); } if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: contact have key, name: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: contact have key, name: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); if (globals.bDebugLog && db_mc_isMeta(ccs->hContact)) - globals.debuglog << std::string(time_str() + ": info: protocol is metacontacts, name: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: protocol is metacontacts, name: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); if (!isContactSecured(ccs->hContact) || db_mc_isMeta(ccs->hContact)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: contact not secured, name: " + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: contact not secured, name: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact))); return Proto_ChainSend(w, ccs); } return returnNoError(ccs->hContact); @@ -878,13 +878,13 @@ int HookSendMsg(WPARAM w, LPARAM l) if (isContactSecured(hContact) && strstr((char*)dbei->pBlob, "-----BEGIN PGP MESSAGE-----")) //our service data, can be double added by metacontacts e.w.c. { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); return 1; } if (globals.bAutoExchange && (strstr((char*)dbei->pBlob, "-----PGP KEY RESPONSE-----") || strstr((char*)dbei->pBlob, "-----PGP KEY REQUEST-----"))) ///do not show service data in history { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(send handler): block pgp key request/response event, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(send handler): block pgp key request/response event, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); return 1; } } @@ -893,26 +893,26 @@ int HookSendMsg(WPARAM w, LPARAM l) if (!isContactHaveKey(hContact)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: contact have not key, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: contact have not key, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); if (globals.bAutoExchange && !strstr((char*)dbei->pBlob, "-----PGP KEY REQUEST-----") && !strstr((char*)dbei->pBlob, "-----BEGIN PGP PUBLIC KEY BLOCK-----") && globals.gpg_valid) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: checking for autoexchange possibility, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: checking for autoexchange possibility, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); LPSTR proto = GetContactProto(hContact); DWORD uin = db_get_dw(hContact, proto, "UIN", 0); if (uin) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like icq, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like icq, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); char *proto2 = GetContactProto(hContact); if (ProtoServiceExists(proto2, PS_ICQ_CHECKCAPABILITY)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): checking for autoexchange icq capability, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): checking for autoexchange icq capability, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); ICQ_CUSTOMCAP cap = { 0 }; strncpy(cap.caps, "GPGAutoExchange", sizeof(cap.caps)); if (CallProtoService(proto2, PS_ICQ_CHECKCAPABILITY, hContact, (LPARAM)&cap)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): sending key requiest, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(autoexchange, icq): sending key requiest, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)"-----PGP KEY REQUEST-----"); globals.hcontact_data[hContact].msgs_to_send.push_back((char*)dbei->pBlob); new boost::thread(boost::bind(send_encrypted_msgs_thread, (void*)hContact)); @@ -924,7 +924,7 @@ int HookSendMsg(WPARAM w, LPARAM l) wchar_t *jid = UniGetContactSettingUtf(hContact, proto, "jid", L""); if (jid[0]) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(autoexchange): protocol looks like jabber, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + 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); @@ -939,7 +939,7 @@ int HookSendMsg(WPARAM w, LPARAM l) mir_free(caps); if (str.find(L"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(pcli->pfnGetContactDisplayName(hContact, 0))); + 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-----"); globals.hcontact_data[hContact].msgs_to_send.push_back((char*)dbei->pBlob); new boost::thread(boost::bind(send_encrypted_msgs_thread, (void*)hContact)); @@ -972,7 +972,7 @@ int HookSendMsg(WPARAM w, LPARAM l) } if (!isContactSecured(hContact)) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": event message: \"" + (char*)dbei->pBlob + "\" passed event filter, contact " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0)) + " is unsecured"); + globals.debuglog << std::string(time_str() + ": event message: \"" + (char*)dbei->pBlob + "\" passed event filter, contact " + toUTF8(Clist_GetContactDisplayName(hContact)) + " is unsecured"); return 0; } if (!(dbei->flags & DBEF_SENT) && db_mc_isMeta((MCONTACT)w)) { @@ -981,7 +981,7 @@ int HookSendMsg(WPARAM w, LPARAM l) tmp[28] = '\0'; if (strstr(tmp, "-----BEGIN PGP MESSAGE-----")) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": info(send handler): block pgp message event, name: " + toUTF8(Clist_GetContactDisplayName(hContact))); return 1; } } diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 4985da33cb..0fa5890093 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -61,7 +61,7 @@ public: int i = 1; for (auto &hContact : Contacts()) { if (isContactHaveKey(hContact)) { - wchar_t *name = pcli->pfnGetContactDisplayName(hContact, 0); + wchar_t *name = Clist_GetContactDisplayName(hContact); int row = list_USERLIST.AddItem(L"", 0); list_USERLIST.SetItemText(row, 0, name); @@ -589,7 +589,7 @@ public: MCONTACT hcnt = db_mc_tryMeta(hContact); { wstring msg = TranslateT("Load Public GPG Key for "); - msg += pcli->pfnGetContactDisplayName(hcnt, 0); + msg += Clist_GetContactDisplayName(hcnt, 0); this->SetCaption(msg.c_str()); } if (!hcnt) { @@ -642,7 +642,7 @@ public: str.append(tmp3); mir_free(tmp3); string msg = Translate("Load Public GPG Key for "); - msg += _T2A(pcli->pfnGetContactDisplayName(hcnt, 0)); + msg += _T2A(Clist_GetContactDisplayName(hcnt)); msg += " (Key ID: "; msg += globals.hcontact_data[hcnt].key_in_prescense; msg += Translate(" found in presence, and exists in keyring.)"); diff --git a/plugins/New_GPG/src/ui.cpp b/plugins/New_GPG/src/ui.cpp index d9677fd529..396869d09d 100755 --- a/plugins/New_GPG/src/ui.cpp +++ b/plugins/New_GPG/src/ui.cpp @@ -916,7 +916,7 @@ void CDlgNewKey::OnInitDialog() btn_IMPORT.SetText(tmp[0] ? TranslateT("Replace") : TranslateT("Accept")); mir_free(tmp); tmp = new wchar_t[256]; - mir_snwprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_snwprintf(tmp, 255 * sizeof(wchar_t), TranslateT("Received key from %s"), Clist_GetContactDisplayName(hContact)); lbl_KEY_FROM.SetText(tmp); mir_free(tmp); } diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 3781161311..33de2251a7 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -320,12 +320,12 @@ int onProtoAck(WPARAM, LPARAM l) dbsetting += "_Password"; pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), L""); if (mir_wstrlen(pass) > 0 && globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + keyid + ", trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password in database for key ID: " + keyid + ", trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with password"); } else { pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", L""); if (mir_wstrlen(pass) > 0 && globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password for all keys in database, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with password"); } if (mir_wstrlen(pass) > 0) { cmd.push_back(L"--passphrase"); @@ -333,12 +333,12 @@ int onProtoAck(WPARAM, LPARAM l) } else if (globals.password) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with password"); + globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with password"); cmd.push_back(L"--passphrase"); cmd.push_back(globals.password); } else if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: passwords not found in database or memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " with out password"); + globals.debuglog << std::string(time_str() + ": info: passwords not found in database or memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " with out password"); mir_free(pass); mir_free(keyid); } @@ -352,7 +352,7 @@ int onProtoAck(WPARAM, LPARAM l) return 0; while (out.find("public key decryption failed: bad passphrase") != string::npos) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: failed to decrypt messaage from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0)) + " password needed, trying to get one"); + globals.debuglog << std::string(time_str() + ": info: failed to decrypt messaage from " + toUTF8(Clist_GetContactDisplayName(ack->hContact)) + " password needed, trying to get one"); if (globals._terminate) break; { //save inkey id @@ -370,7 +370,7 @@ int onProtoAck(WPARAM, LPARAM l) std::vector<wstring> cmd2 = cmd; if (globals.password) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(pcli->pfnGetContactDisplayName(ack->hContact, 0))); + globals.debuglog << std::string(time_str() + ": info: found password in memory, trying to decrypt message from " + toUTF8(Clist_GetContactDisplayName(ack->hContact))); std::vector<wstring> tmp; tmp.push_back(L"--passphrase"); tmp.push_back(globals.password); @@ -945,7 +945,7 @@ bool isContactSecured(MCONTACT hContact) BYTE gpg_enc = db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0); if (!gpg_enc) { if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": encryption is turned off for " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": encryption is turned off for " + toUTF8(Clist_GetContactDisplayName(hContact))); return false; } if (!db_mc_isMeta(hContact)) { @@ -953,13 +953,13 @@ bool isContactSecured(MCONTACT hContact) if (!key[0]) { mir_free(key); if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": encryption is turned off for " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": encryption is turned off for " + toUTF8(Clist_GetContactDisplayName(hContact))); return false; } mir_free(key); } if (globals.bDebugLog) - globals.debuglog << std::string(time_str() + ": encryption is turned on for " + toUTF8(pcli->pfnGetContactDisplayName(hContact, 0))); + globals.debuglog << std::string(time_str() + ": encryption is turned on for " + toUTF8(Clist_GetContactDisplayName(hContact))); return true; } |