diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-18 15:33:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-18 15:33:48 +0300 |
commit | 4be051a155c0fbc47c1e0eab75da6b4ba8bb2327 (patch) | |
tree | 6bd02758efeec37f6bf1b7483f5c046d5b2990cd /plugins/New_GPG/src/messages.cpp | |
parent | 18e00b8e27272dde88c47560130298ddf8515474 (diff) |
NewGPG:
- fixes #2259 (New_GPG лезет на другие аккаунты и пытается расшифровывать чаты);
- fixes #2258 (New_GPG is broken after chat window redesign);
- version bump
Diffstat (limited to 'plugins/New_GPG/src/messages.cpp')
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index 81b0c94a58..a8520d510b 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -339,6 +339,7 @@ static void RecvMsgSvc_func(RecvParams *param) } } } + if (g_plugin.getByte(db_mc_isMeta(hContact) ? metaGetMostOnline(hContact) : hContact, "GPGEncryption")) { HistoryLog(hContact, db_event(param->msg, param->timestamp, 0, dbflags | DBEF_READ)); delete param; @@ -507,6 +508,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) 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 << "info(autoexchange): received key request from: " + toUTF8(Clist_GetContactDisplayName(ccs->hContact)); @@ -575,11 +577,10 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) return; } - if (!globals.bJabberAPI) { //force jabber to handle encrypted message by itself - params.addParam(L"--comment"); - params.addParam(L"\"\""); - params.addParam(L"--no-version"); - } + params.addParam(L"--comment"); + params.addParam(L"\"\""); + params.addParam(L"--no-version"); + if (g_plugin.getByte(hContact, "bAlwaysTrust", 0)) { params.addParam(L"--trust-model"); params.addParam(L"always"); @@ -587,10 +588,7 @@ void SendMsgSvc_func(MCONTACT hContact, char *msg, DWORD flags) params.addParam(L"--batch"); params.addParam(L"--yes"); params.addParam(L"-eatr"); - wchar_t *tmp2 = mir_a2u(tmp); - - params.addParam(tmp2); - mir_free(tmp2); + params.addParam(_A2T(tmp).get()); } CMStringW path(g_plugin.getMStringW("szHomePath")); @@ -787,6 +785,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if (!isContactHaveKey(hContact)) { if (globals.bDebugLog) globals.debuglog << "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 << "info: checking for autoexchange possibility, name: " + toUTF8(Clist_GetContactDisplayName(hContact)); |