diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-02 22:24:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-02 22:24:11 +0000 |
commit | fe09f8b1b3e119ee88332a79bdfb143b907c2805 (patch) | |
tree | ef4c19d6156da0fa58c6427d24b6c0cb10f77ad8 /protocols/JabberG/src/jabber_svc.cpp | |
parent | c55fd3e3c7312d6a76bc8037df78c07cc269935f (diff) |
static array of resources replaced with LIST<>
git-svn-id: http://svn.miranda-ng.org/main/trunk@5559 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_svc.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_svc.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 6e24c20f52..c4fb05571e 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -156,7 +156,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) BOOL isXVcard = getByte(AI->hContact, "AvatarXVcard", 0);
TCHAR szJid[JABBER_MAX_JID_LEN];
- if (item->resourceCount != NULL && !isXVcard) {
+ if (item->arResources.getCount() != NULL && !isXVcard) {
TCHAR *bestResName = ListGetBestClientResourceNamePtr(dbv.ptszVal);
mir_sntprintf(szJid, SIZEOF(szJid), bestResName?_T("%s/%s"):_T("%s"), dbv.ptszVal, bestResName);
}
@@ -806,21 +806,22 @@ LPTSTR CJabberSysInterface::GetResourceList(LPCTSTR jid) if (item == NULL)
return NULL;
- if (item->pResources == NULL)
+ if (!item->arResources.getCount())
return NULL;
int i;
int iLen = 1; // 1 for extra zero terminator at the end of the string
// calculate total necessary string length
- for (i=0; i<item->resourceCount; i++)
- iLen += lstrlen(item->pResources[i].resourceName) + 1;
+ for (i=0; i<item->arResources.getCount(); i++)
+ iLen += lstrlen(item->arResources[i]->resourceName) + 1;
// allocate memory and fill it
LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(TCHAR));
LPTSTR p = str;
- for (i=0; i<item->resourceCount; i++) {
- lstrcpy(p, item->pResources[i].resourceName);
- p += lstrlen(item->pResources[i].resourceName) + 1;
+ for (i=0; i<item->arResources.getCount(); i++) {
+ JABBER_RESOURCE_STATUS *r = item->arResources[i];
+ lstrcpy(p, r->resourceName);
+ p += lstrlen(r->resourceName) + 1;
}
*p = 0; // extra zero terminator
|