summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_misc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-11-10 12:26:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-11-10 12:26:50 +0300
commit75b344c4c8b4148602279b51bc2cc5d45b03c324 (patch)
treeaac200ebcda11e62bb113db523f722bc742e3ba5 /protocols/JabberG/src/jabber_misc.cpp
parent79f7652b02de068a55029e3fb1010c9fc9e868e2 (diff)
more strict version of caps reading
Diffstat (limited to 'protocols/JabberG/src/jabber_misc.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 7ade567dec..91d7955c7e 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -277,17 +277,13 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
debugLogW(L"JabberUpdateMirVer: for jid %s", item->jid);
- pResourceStatus p(nullptr);
if (item->resourceMode == RSMODE_LASTSEEN)
- p = item->m_pLastSeenResource;
+ UpdateMirVer(hContact, pResourceStatus(item->m_pLastSeenResource));
else if (item->resourceMode == RSMODE_MANUAL)
- p = item->m_pManualResource;
-
- if (p)
- UpdateMirVer(hContact, p);
+ UpdateMirVer(hContact, pResourceStatus(item->m_pManualResource));
}
-void CJabberProto::FormatMirVer(pResourceStatus &resource, CMStringW &res)
+void CJabberProto::FormatMirVer(const pResourceStatus &resource, CMStringW &res)
{
res.Empty();
if (resource == nullptr)
@@ -338,10 +334,13 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMStringW &res)
res.AppendFormat(L" [%s]", resource->m_tszResourceName);
}
-void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
+void CJabberProto::UpdateMirVer(MCONTACT hContact, const pResourceStatus &r)
{
+ if (r == nullptr)
+ return;
+
CMStringW tszMirVer;
- FormatMirVer(resource, tszMirVer);
+ FormatMirVer(r, tszMirVer);
if (!tszMirVer.IsEmpty())
setWString(hContact, "MirVer", tszMirVer);
@@ -350,8 +349,8 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
return;
wchar_t szFullJid[JABBER_MAX_JID_LEN];
- if (resource->m_tszResourceName && !wcschr(jid, '/'))
- mir_snwprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
+ if (r->m_tszResourceName && !wcschr(jid, '/'))
+ mir_snwprintf(szFullJid, L"%s/%s", jid, r->m_tszResourceName);
else
mir_wstrncpy(szFullJid, jid, _countof(szFullJid));
setWString(hContact, DBSETTING_DISPLAY_UID, szFullJid);