summaryrefslogtreecommitdiff
path: root/protocols/JabberG/jabber_misc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-03 18:15:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-03 18:15:52 +0000
commit4641ff7a3a0d6a124c22a5c044bffd04073720fc (patch)
treedd0abb5de957189fc8dd18cd83b3cf97eafe853b /protocols/JabberG/jabber_misc.cpp
parentad4e888349c2d220828c93d2d50635ff23a6fc72 (diff)
shit dropped out
git-svn-id: http://svn.miranda-ng.org/main/trunk@738 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/jabber_misc.cpp')
-rw-r--r--protocols/JabberG/jabber_misc.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/protocols/JabberG/jabber_misc.cpp b/protocols/JabberG/jabber_misc.cpp
index 1faeaaadda..c50c48ecdd 100644
--- a/protocols/JabberG/jabber_misc.cpp
+++ b/protocols/JabberG/jabber_misc.cpp
@@ -467,10 +467,15 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
Log("JabberUpdateMirVer: for jid " TCHAR_STR_PARAM, item->jid);
- JABBER_RESOURCE_STATUS *resource = item->resourceMode == RSMODE_MANUAL ? item->manualResource : item->lastSeenResource;
- if (resource == NULL) resource = &item->resource[0];
+ int resource = -1;
+ if (item->resourceMode == RSMODE_LASTSEEN)
+ resource = item->lastSeenResource;
+ else if (item->resourceMode == RSMODE_MANUAL)
+ resource = item->manualResource;
+ if ((resource < 0) || (resource >= item->resourceCount))
+ return;
- UpdateMirVer( hContact, resource );
+ UpdateMirVer( hContact, &item->resource[resource] );
}
void CJabberProto::FormatMirVer(JABBER_RESOURCE_STATUS *resource, TCHAR *buf, int bufSize)