diff options
author | George Hazan <ghazan@miranda.im> | 2017-08-14 17:57:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-08-14 17:57:18 +0300 |
commit | 2c33d3a74a28953786f9fd5b76a76c1184751f21 (patch) | |
tree | c1f341679a62b339e016ac0faac1749fc07534f7 /protocols/JabberG/src/jabber_thread.cpp | |
parent | cc9adee406ad0434e470dfc11ed3896c6be32073 (diff) |
Jabber: version info to be cached into a profile
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 49f6f8a8e8..eef8392df4 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1465,6 +1465,23 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) 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) {
r->m_pCaps = m_clientCapsManager.SetClientCaps(szNode, szVer, L"", JABBER_RESOURCE_CAPS_UNINIT);
GetResourceCapabilites(from, false);
}
|