diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 20:30:07 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 20:30:07 +0000 |
commit | 5756772ef9e9fd5b4a730d8a16737996cbec55f5 (patch) | |
tree | b154b3f9e56ceb86b3385d0f59d7341f5ac9b71e /protocols/JabberG/src/jabber_util.cpp | |
parent | 2a60812b64635ecd655131217f9cb0fa077575dc (diff) |
less cycles, simplier code
git-svn-id: http://svn.miranda-ng.org/main/trunk@5434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_util.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_util.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 69b2327e51..9814cd302c 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -153,25 +153,17 @@ JABBER_RESOURCE_STATUS* CJabberProto::ResourceInfoFromJID(const TCHAR *jid) if ( !jid)
return NULL;
- JABBER_LIST_ITEM *item = NULL;
- if ((item = ListGetItemPtr(LIST_VCARD_TEMP, jid)) == NULL)
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_VCARD_TEMP, jid);
+ if (item == NULL)
item = ListGetItemPtr(LIST_ROSTER, jid);
- if (item == NULL) return NULL;
+ if (item == NULL)
+ return NULL;
const TCHAR *p = _tcschr(jid, '/');
if (p == NULL)
return &item->itemResource;
- if (*++p == '\0') return NULL;
-
- JABBER_RESOURCE_STATUS *r = item->pResources;
- if (r == NULL) return NULL;
-
- int i;
- for (i=0; i<item->resourceCount && _tcscmp(r->resourceName, p); i++, r++);
- if (i >= item->resourceCount)
- return NULL;
- return r;
+ return item->findResource(p+1);
}
JABBER_LIST_ITEM* CJabberProto::GetItemFromContact(HANDLE hContact)
|