From 3affb5c66976bda2e61a0f4206ccc0b1fb2e9283 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 21 Jun 2020 17:23:35 +0300 Subject: Jabber: cause MAM doesn't set ids for outgoing messages, our own messages (with the same resource) shall be ignored --- protocols/JabberG/src/jabber_thread.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 57b3727c90..c4b6c54956 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1086,8 +1086,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) if (IsMyOwnJID(from)) { carbon = XmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_CARBONS); if (!carbon) { - carbon = XmlGetChildByTag(node, "sent", "xmlns", JABBER_FEAT_CARBONS); - if (carbon) + if (carbon = XmlGetChildByTag(node, "sent", "xmlns", JABBER_FEAT_CARBONS)) carbonSent = true; } if (carbon) { @@ -1133,6 +1132,10 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) node = xmlMessage; type = XmlGetAttr(node, "type"); from = XmlGetAttr(node, "from"); + if (!mir_strcmpi(from, info->fullJID)) { + debugLogA("MAM: outgoing message from this machine (%s), ignored", from); + return; + } } if (auto *xmlDelay = XmlGetChildByTag(xmlForwarded, "delay", "xmlns", JABBER_FEAT_DELAY)) { if (auto *ptszTimeStamp = XmlGetAttr(xmlDelay, "stamp")) -- cgit v1.2.3