diff options
-rwxr-xr-x | protocols/JabberG/src/jabber_caps.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index bc90345469..44fa596a36 100755 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -140,18 +140,17 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo) for (int i = 1; (xform = XmlGetNthChild(query, L"x", i)) != nullptr; i++) {
wchar_t *szFormTypeValue = XPath(xform, L"field[@var='FORM_TYPE']/value");
if (!mir_wstrcmp(szFormTypeValue, L"urn:xmpp:dataforms:softwareinfo")) {
- pCaps->m_szOs = mir_wstrdup(XPath(xform, L"field[@var='os']/value"));
- pCaps->m_szOsVer = mir_wstrdup(XPath(xform, L"field[@var='os_version']/value"));
- pCaps->m_szSoft = mir_wstrdup(XPath(xform, L"field[@var='software']/value"));
- pCaps->m_szSoftVer = mir_wstrdup(XPath(xform, L"field[@var='software_version']/value"));
- pCaps->m_szSoftMir = mir_wstrdup(XPath(xform, L"field[@var='x-miranda-core-version']/value"));
-
JSONNode root;
- root.push_back(JSONNode("o", _T2A(pCaps->m_szOs)));
- root.push_back(JSONNode("ov", _T2A(pCaps->m_szOsVer)));
- root.push_back(JSONNode("s", _T2A(pCaps->m_szSoft)));
- root.push_back(JSONNode("sv", _T2A(pCaps->m_szSoftVer)));
- root.push_back(JSONNode("sm", _T2A(pCaps->m_szSoftMir)));
+ if (pCaps->m_szOs = mir_wstrdup(XPath(xform, L"field[@var='os']/value")))
+ root.push_back(JSONNode("o", _T2A(pCaps->m_szOs)));
+ if (pCaps->m_szOsVer = mir_wstrdup(XPath(xform, L"field[@var='os_version']/value")))
+ root.push_back(JSONNode("ov", _T2A(pCaps->m_szOsVer)));
+ if (pCaps->m_szSoft = mir_wstrdup(XPath(xform, L"field[@var='software']/value")))
+ root.push_back(JSONNode("s", _T2A(pCaps->m_szSoft)));
+ if (pCaps->m_szSoftVer = mir_wstrdup(XPath(xform, L"field[@var='software_version']/value")))
+ root.push_back(JSONNode("sv", _T2A(pCaps->m_szSoftVer)));
+ if (pCaps->m_szSoftMir = mir_wstrdup(XPath(xform, L"field[@var='x-miranda-core-version']/value")))
+ root.push_back(JSONNode("sm", _T2A(pCaps->m_szSoftMir)));
root.push_back(JSONNode("ñ", CMStringA(FORMAT, "%lld", jcbCaps)));
CMStringA szName(FORMAT, "%S#%S", pCaps->GetNode(), pCaps->GetHash());
|