summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-09-06 19:21:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-09-06 19:21:37 +0300
commite7179d7a6ec6299a11e0f51e6c92ae5ba22144d2 (patch)
tree7e1485f08ae9d13a34cc797d6409fce42b65c5ea /protocols/JabberG/src
parentd947ecd5aa717a3856384855b41d30a8550fa762 (diff)
Jabber: partially restored ability to process caps from old clients that do not support XEP-0115
Diffstat (limited to 'protocols/JabberG/src')
-rwxr-xr-xprotocols/JabberG/src/jabber_caps.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index e3863e7ea9..3c716018a4 100755
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -293,7 +293,20 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, bool app
return jcbCaps | r->m_jcbManualDiscoveredCaps;
}
- return JABBER_RESOURCE_CAPS_NONE;
+ // no XEP-0115: send query each time it's needed
+ switch(r->m_dwDiscoInfoRequestTime) {
+ case -1:
+ return r->m_jcbCachedCaps;
+
+ case 0:
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
+ pInfo->SetTimeout(JABBER_RESOURCE_CAPS_QUERY_TIMEOUT);
+ r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
+
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO));
+ break;
+ }
+ return JABBER_RESOURCE_CAPS_IN_PROGRESS;
}
/////////////////////////////////////////////////////////////////////////////////////////