summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_groupchat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-21 13:40:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-21 13:40:52 +0000
commitc69a9c892f52056d452ad8520e6c09b6956f30e3 (patch)
treecf26cee03ae18c38486515e94ec18068b38cbd41 /protocols/JabberG/src/jabber_groupchat.cpp
parent8b6824e3ec3ed7340db33bcbe592321b6afb0a00 (diff)
smart pointers for Jabber resources
git-svn-id: http://svn.miranda-ng.org/main/trunk@6155 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_groupchat.cpp')
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 8ad5307200..7597c9bdd8 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -864,7 +864,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol
if (newNick == NULL)
return;
- JABBER_RESOURCE_STATUS *r = item->findResource(oldNick);
+ pResourceStatus r( item->findResource(oldNick));
if (r == NULL)
return;
@@ -914,7 +914,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
if (item == NULL)
return;
- JABBER_RESOURCE_STATUS *r = item->findResource(resource);
+ pResourceStatus r( item->findResource(resource));
HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
if (nNode == NULL)
@@ -959,9 +959,9 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
priority = (char)_ttoi(ptszPriority);
bool bStatusChanged = false, bRoomCreated = false, bAffiliationChanged = false, bRoleChanged = false;
- int newRes = (ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) == 0) ? 0 : GC_EVENT_JOIN;
+ int newRes = ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) ? GC_EVENT_JOIN : 0;
- if (JABBER_RESOURCE_STATUS *oldRes = ListFindResource(LIST_CHATROOM, from))
+ if (pResourceStatus oldRes = ListFindResource(LIST_CHATROOM, from))
if ((oldRes->status != status) || lstrcmp_null(oldRes->statusMessage, str))
bStatusChanged = true;
@@ -1013,7 +1013,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// show status change if needed
if (bStatusChanged)
- if (JABBER_RESOURCE_STATUS *res = ListFindResource(LIST_CHATROOM, from))
+ if (pResourceStatus res = ListFindResource(LIST_CHATROOM, from))
GcLogShowInformation(item, res, INFO_STATUS);
// Update groupchat log window
@@ -1198,7 +1198,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
msgTime = now;
if (resource != NULL) {
- JABBER_RESOURCE_STATUS *r = item->findResource(resource);
+ pResourceStatus r( item->findResource(resource));
nick = (r && r->nick) ? r->nick : resource;
}
else nick = NULL;