summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-10-13 00:38:23 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-10-13 00:38:32 +0300
commit196e01a2ca9f8aefbd3ac55eedc955f56d3d6428 (patch)
treee7695abc56934941307ffb58cf76ec72b8dfcb44 /protocols/JabberG/src/jabber_thread.cpp
parent6da03d864d6f778c6d6cbab4229675f276036b79 (diff)
fixes #987 (more fixes for clients that don't support XEP-0115)
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f2518a4e20..e8e0e2c381 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1455,7 +1455,12 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node, pResourceStatus &r)
bin2hexW(hashOut, _countof(hashOut), szHashOut);
r->m_pCaps = m_clientCapsManager.GetPartialCaps(szNode, szHashOut);
if (r->m_pCaps == nullptr)
- r->m_pCaps = m_clientCapsManager.SetClientCaps(szNode, szHashOut, szVer, JABBER_RESOURCE_CAPS_NONE);
+ GetCachedCaps(szNode, szHashOut, r);
+
+ if (r->m_pCaps == nullptr) {
+ r->m_pCaps = m_clientCapsManager.SetClientCaps(szNode, szHashOut, szVer, JABBER_RESOURCE_CAPS_UNINIT);
+ RequestOldCapsInfo(r, from);
+ }
MCONTACT hContact = HContactFromJID(from);
if (hContact)
@@ -1463,22 +1468,8 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node, pResourceStatus &r)
}
else {
r->m_pCaps = m_clientCapsManager.GetPartialCaps(szNode, szVer);
- if (r->m_pCaps == nullptr) {
- CMStringA szName(FORMAT, "%S#%S", szNode, szVer);
- ptrA szValue(db_get_sa(0, "JabberCaps", szName));
- if (szValue != 0) {
- JSONNode root = JSONNode::parse(szValue);
- if (root) {
- CMStringW wszCaps = root["c"].as_mstring();
- r->m_pCaps = m_clientCapsManager.SetClientCaps(szNode, szVer, nullptr, _wtoi64(wszCaps));
- r->m_pCaps->m_szOs = mir_wstrdup(root["o"].as_mstring());
- r->m_pCaps->m_szOsVer = mir_wstrdup(root["ov"].as_mstring());
- r->m_pCaps->m_szSoft = mir_wstrdup(root["s"].as_mstring());
- r->m_pCaps->m_szSoftVer = mir_wstrdup(root["sv"].as_mstring());
- r->m_pCaps->m_szSoftMir = mir_wstrdup(root["sm"].as_mstring());
- }
- }
- }
+ if (r->m_pCaps == nullptr)
+ GetCachedCaps(szNode, szVer, r);
if (r->m_pCaps == nullptr) {
r->m_pCaps = m_clientCapsManager.SetClientCaps(szNode, szVer, L"", JABBER_RESOURCE_CAPS_UNINIT);