summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-14 18:26:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-14 18:26:11 +0300
commit4baef0a80f8e9a51c4e4466d49cd6adde2d7eb15 (patch)
tree5f360582264730f2788a94a18956af6df3a00f20
parent2c33d3a74a28953786f9fd5b76a76c1184751f21 (diff)
code cleaning
-rwxr-xr-xprotocols/JabberG/src/jabber_caps.cpp21
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());