summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_events.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-20 11:11:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-20 11:11:48 +0000
commit874cdbe42cfe376f0e72fd5fe6bad0d2f75f4ee3 (patch)
treecd6167452b51f8ac80b3a36ffb36c1e08f3c9ada /protocols/JabberG/src/jabber_events.cpp
parent2fe00cdd66d4559cc43a5f27c19ddc79a43676eb (diff)
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@5427 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_events.cpp')
-rw-r--r--protocols/JabberG/src/jabber_events.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index b0484c638b..46412d2798 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -88,7 +88,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hCon
if (getTString(hContact, "jid", &jid))
return;
- JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
db_free(&jid);
if (item == NULL)
return;
@@ -130,7 +130,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hC
if (getTString(hContact, "jid", &jid))
return;
- JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
db_free(&jid);
if (item == NULL)
return;
@@ -142,16 +142,14 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hC
return;
}
- TCHAR* newNick = sttSettingToTchar(cws);
- if (newNick) {
- if (lstrcmp(item->nick, newNick)) {
- Log("Renaming contact %S: %S -> %S", item->jid, item->nick, newNick);
- AddContactToRoster(item->jid, newNick, item->group);
- }
- mir_free(newNick);
-} }
+ ptrT newNick( sttSettingToTchar(cws));
+ if (newNick && lstrcmp(item->nick, newNick)) {
+ Log("Renaming contact %S: %S -> %S", item->jid, item->nick, newNick);
+ AddContactToRoster(item->jid, newNick, item->group);
+ }
+}
-void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDLE hContact)
+void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HANDLE hContact)
{
if (cws->value.type != DBVT_DELETED && !(cws->value.type==DBVT_BYTE && cws->value.bVal==0))
return;