diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-03 17:27:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-03 17:27:06 +0000 |
commit | a9fac2d04887b80526ab90c4c8ce45cd482e80b2 (patch) | |
tree | 0bc62363778c6110d16016816650278a147049f7 /protocols/JabberG/src/jabber_events.cpp | |
parent | 9257dc8641a40437ceda38b65f4be7390e57954b (diff) |
- filetransfer::iqid converted from string to int;
- further code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@6319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_events.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index b4fc432a5d..f71ee0dcc6 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -77,32 +77,22 @@ static TCHAR* sttSettingToTchar(DBCONTACTWRITESETTING* cws) void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hContact)
{
- DBVARIANT jid, dbv;
- if (getTString(hContact, "jid", &jid))
- return;
-
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
- db_free(&jid);
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT( getTStringA(hContact, "jid")));
if (item == NULL)
return;
- TCHAR *nick;
- if ( !db_get_ts(hContact, "CList", "MyHandle", &dbv)) {
- nick = mir_tstrdup(dbv.ptszVal);
- db_free(&dbv);
- }
- else if ( !getTString(hContact, "Nick", &dbv)) {
- nick = mir_tstrdup(dbv.ptszVal);
- db_free(&dbv);
- }
- else nick = JabberNickFromJID(item->jid);
- if (nick == NULL)
+ ptrT tszNick( db_get_tsa(hContact, "CList", "MyHandle"));
+ if (tszNick == NULL)
+ tszNick = getTStringA(hContact, "Nick");
+ if (tszNick == NULL)
+ tszNick = JabberNickFromJID(item->jid);
+ if (tszNick == NULL)
return;
if (cws->value.type == DBVT_DELETED) {
if (item->group != NULL) {
Log("Group set to nothing");
- AddContactToRoster(item->jid, nick, NULL);
+ AddContactToRoster(item->jid, tszNick, NULL);
}
}
else {
@@ -110,21 +100,15 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hCon if (cws->value.pszVal != NULL && lstrcmp(p, item->group)) {
Log("Group set to %S", p);
if (p)
- AddContactToRoster(item->jid, nick, p);
+ AddContactToRoster(item->jid, tszNick, p);
}
mir_free(p);
}
- mir_free(nick);
}
void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hContact)
{
- DBVARIANT jid;
- if (getTString(hContact, "jid", &jid))
- return;
-
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
- db_free(&jid);
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT( getTStringA(hContact, "jid")));
if (item == NULL)
return;
|