diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-11 15:57:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-11 15:57:51 +0300 |
commit | 7c41ebba4f0c04a4a779ac0698027ec738cac0ea (patch) | |
tree | 1e32672878e053543253522462d57582c4767f1f | |
parent | c0c3c12b073078d50dd6c732d5ddba7aced46a91 (diff) |
Jabber: fix for sending receipts to offline contacts
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 7d3fe86868..74b957ef82 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1005,6 +1005,10 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz m << XATTR("to", szClientJid);
+ bool bSendReceipt = (m_bMsgAck || getByte(hContact, "MsgAck", false));
+ if (bSendReceipt)
+ m << XCHILDNS("request", JABBER_FEAT_MESSAGE_RECEIPTS);
+
if (
// if message delivery check disabled by entity caps manager
(jcb & JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY) ||
@@ -1013,23 +1017,17 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz // if message sent to groupchat
!mir_strcmp(msgType, "groupchat") ||
// if message delivery check disabled in settings
- !m_bMsgAck || !getByte(hContact, "MsgAck", true))
+ !bSendReceipt)
{
- if (mir_strcmp(msgType, "groupchat")) {
- id = SerialNext();
+ if (mir_strcmp(msgType, "groupchat"))
XmlAddAttrID(m, id);
- }
+
m_ThreadInfo->send(m);
ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, nullptr, id));
}
else {
XmlAddAttrID(m, id);
-
- // message receipts XEP priority
- if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
- m << XCHILDNS("request", JABBER_FEAT_MESSAGE_RECEIPTS);
-
m_ThreadInfo->send(m);
}
|