summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_util.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-11-10 12:26:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-11-10 12:26:50 +0300
commit75b344c4c8b4148602279b51bc2cc5d45b03c324 (patch)
treeaac200ebcda11e62bb113db523f722bc742e3ba5 /protocols/JabberG/src/jabber_util.cpp
parent79f7652b02de068a55029e3fb1010c9fc9e868e2 (diff)
more strict version of caps reading
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_util.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 38b4d0bcc4..2ec6c71e85 100755
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -83,13 +83,21 @@ pResourceStatus CJabberProto::ResourceInfoFromJID(const wchar_t *jid)
if (jid == nullptr)
return nullptr;
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_VCARD_TEMP, jid);
+ const wchar_t *p = wcschr(jid, '/');
+
+ JABBER_LIST_ITEM *item = nullptr;
+ if (p) {
+ wchar_t szJid[JABBER_MAX_JID_LEN];
+ JabberStripJid(jid, szJid, _countof(szJid));
+ item = ListGetItemPtr(LIST_CHATROOM, szJid);
+ }
+ if (item == nullptr)
+ item = ListGetItemPtr(LIST_VCARD_TEMP, jid);
if (item == nullptr)
item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == nullptr)
return nullptr;
- const wchar_t *p = wcschr(jid, '/');
if (p == nullptr)
return item->getTemp();