From 4baef0a80f8e9a51c4e4466d49cd6adde2d7eb15 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 14 Aug 2017 18:26:11 +0300 Subject: code cleaning --- protocols/JabberG/src/jabber_caps.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'protocols/JabberG/src') 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()); -- cgit v1.2.3