summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-08-03 14:24:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-08-03 14:24:36 +0300
commit87814134e5a69926d8323f577859d44d7026b945 (patch)
tree4979504e8e0acdbaa92753444037317a5f04770e
parent568d7363f4cc284173ad1418e23ca30066968489 (diff)
Jabber: according to XEP-085 client MUST generate GONE event, if a message window is closed
-rw-r--r--protocols/JabberG/src/jabber_list.h3
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp8
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp7
4 files changed, 3 insertions, 19 deletions
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 009e0e7ab8..258f0c8a4e 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -108,9 +108,6 @@ public:
JabberCapsBits m_jcbCachedCaps;
JabberCapsBits m_jcbManualDiscoveredCaps;
-
- // XEP-0085 gone event support
- bool m_bMessageSessionActive;
};
class pResourceStatus
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 87db94d7a3..70516adde5 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -832,12 +832,8 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
char jid[JABBER_MAX_JID_LEN];
if (GetClientJID(event->hContact, jid, _countof(jid))) {
pResourceStatus r(ResourceInfoFromJID(jid));
- if (r && r->m_bMessageSessionActive) {
- r->m_bMessageSessionActive = false;
-
- if (m_bEnableChatStates && (GetResourceCapabilities(jid, r) & JABBER_CAPS_CHATSTATES))
- m_ThreadInfo->send(XmlNode("message") << XATTR("to", jid) << XATTR("type", "chat") << XATTRID(SerialNext()) << XCHILDNS("gone", JABBER_FEAT_CHATSTATES));
- }
+ if (m_bEnableChatStates && (GetResourceCapabilities(jid, r) & JABBER_CAPS_CHATSTATES))
+ m_ThreadInfo->send(XmlNode("message") << XATTR("to", jid) << XATTR("type", "chat") << XATTRID(SerialNext()) << XCHILDNS("gone", JABBER_FEAT_CHATSTATES));
}
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index ac9e336722..05559615fc 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -947,10 +947,6 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz
}
}
- pResourceStatus r(ResourceInfoFromJID(szClientJid));
- if (r)
- r->m_bMessageSessionActive = true;
-
JabberCapsBits jcb = GetResourceCapabilities(szClientJid);
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 5a4ab0cbdc..f295adbfc7 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1170,11 +1170,8 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
// chatstates inactive event
- if (hContact && XmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
+ if (hContact && XmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
- if (pFromResource)
- pFromResource->m_bMessageSessionActive = false;
- }
// message receipts delivery notification
if (auto *n = XmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
@@ -1361,8 +1358,6 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
if (item != nullptr) {
if (pFromResource) {
- pFromResource->m_bMessageSessionActive = true;
-
JABBER_RESOURCE_STATUS *pLast = item->m_pLastSeenResource;
item->m_pLastSeenResource = pFromResource;
if (item->resourceMode == RSMODE_LASTSEEN && pLast == pFromResource)