From 2610d3eb5477a689146b8bbf9fb8aea27ef89719 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 Aug 2017 21:27:19 +0300 Subject: fixes #667 (XMPP CAPS data is missing required attribute value) --- protocols/JabberG/src/jabber_thread.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'protocols/JabberG/src/jabber_thread.cpp') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 9f6873e487..ead661cfa5 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1439,15 +1439,14 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) if (r == NULL) return; - // check XEP-0115 support, and old style: + // check XEP-0115 support, an old style: HXML n; - if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL || - (n = XmlGetChild(node, "c")) != NULL) - { + if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != nullptr || (n = XmlGetChild(node, "c")) != nullptr) { + const wchar_t *hash = XmlGetAttrValue(n, L"hash"); const wchar_t *szNode = XmlGetAttrValue(n, L"node"); const wchar_t *szVer = XmlGetAttrValue(n, L"ver"); const wchar_t *szExt = XmlGetAttrValue(n, L"ext"); - if (szNode && szVer) { + if (szNode && szVer && hash == nullptr) { r->m_tszCapsNode = mir_wstrdup(szNode); r->m_tszCapsVer = mir_wstrdup(szVer); r->m_tszCapsExt = mir_wstrdup(szExt); -- cgit v1.2.3