diff options
author | George Hazan <ghazan@miranda.im> | 2020-06-23 20:13:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-06-23 20:13:32 +0300 |
commit | f5333c257d4b23bb5f37ab3380dd69191f71429c (patch) | |
tree | b378d4326e904a888f5bb82d69eaa1758131ee6d | |
parent | 74d117e4355b71d7a5660c5b9b67d24df8bfa4c7 (diff) |
Jabber to filter out encrypted outgoing carbon copies
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 4 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 30 |
2 files changed, 19 insertions, 15 deletions
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index f446f5907e..f10efdd76a 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -689,8 +689,8 @@ int HookSendMsg(WPARAM w, LPARAM l) if (!l) return 0; - DBEVENTINFO * dbei = (DBEVENTINFO*)l; - if (dbei->eventType != EVENTTYPE_MESSAGE) + DBEVENTINFO *dbei = (DBEVENTINFO*)l; + if (dbei->eventType != EVENTTYPE_MESSAGE || (dbei->flags & DBEF_READ)) return 0; MCONTACT hContact = (MCONTACT)w; diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index c4b6c54956..e911d7f33d 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1310,19 +1310,23 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) return;
}
- // XEP-0027 is not strict enough, different clients have different implementations
- // additional validation is required
- char *prolog = "-----BEGIN PGP MESSAGE-----";
- char *prolog_newline = "\r\n\r\n";
- char *epilog = "\r\n-----END PGP MESSAGE-----\r\n";
-
- CMStringA tempstring;
- if (!strstr(ptszText, prolog))
- tempstring.Format("%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
- else
- tempstring = ptszText;
-
- szMessage += tempstring;
+ if (carbon && carbonSent)
+ szMessage = TranslateU("Unable to decrypt a carbon copy of the encrypted outgoing message");
+ else {
+ // XEP-0027 is not strict enough, different clients have different implementations
+ // additional validation is required
+ char *prolog = "-----BEGIN PGP MESSAGE-----";
+ char *prolog_newline = "\r\n\r\n";
+ char *epilog = "\r\n-----END PGP MESSAGE-----\r\n";
+
+ CMStringA tempstring;
+ if (!strstr(ptszText, prolog))
+ tempstring.Format("%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
+ else
+ tempstring = ptszText;
+
+ szMessage += tempstring;
+ }
}
else if (!mir_strcmp(pszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
const char *ptszTimeStamp = XmlGetAttr(xNode, "stamp");
|