diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_iqid.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index a099108366..3e6c05eeb1 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -334,33 +334,25 @@ void CJabberProto::OnIqResultSession(HXML iqNode, CJabberIqInfo* pInfo) void CJabberProto::GroupchatJoinByHContact(HANDLE hContact, bool autojoin)
{
- TCHAR* roomjid = JGetStringT(hContact, "ChatRoomID");
- if ( !roomjid) return;
+ ptrT roomjid( db_get_tsa(hContact, m_szModuleName, "ChatRoomID"));
+ if (roomjid == NULL)
+ return;
- TCHAR* room = roomjid;
- TCHAR* server = _tcschr(roomjid, '@');
- if ( !server) {
- mir_free(roomjid);
+ TCHAR *room = roomjid;
+ TCHAR *server = _tcschr(roomjid, '@');
+ if ( !server)
return;
- }
+
server[0] = 0; server++;
- TCHAR *nick = JGetStringT(hContact, "MyNick");
- if ( !nick) {
+ ptrT nick( db_get_tsa(hContact, m_szModuleName, "MyNick"));
+ if (nick == NULL) {
nick = JabberNickFromJID(m_szJabberJID);
- if ( !nick) {
- mir_free(roomjid);
+ if (nick == NULL)
return;
- }
}
- TCHAR *password = JGetStringCrypt(hContact, "LoginPassword");
-
- GroupchatJoinRoom(server, room, nick, password, autojoin);
-
- mir_free(password);
- mir_free(nick);
- mir_free(roomjid);
+ GroupchatJoinRoom(server, room, nick, ptrT(JGetStringCrypt(hContact, "LoginPassword")), autojoin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1062,15 +1054,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) } }
if (hasFn && !hasNick) {
- TCHAR *name = JGetStringT(hContact, "FullName");
- TCHAR *nick = JGetStringT(hContact, "Nick");
- TCHAR *jidNick = JabberNickFromJID(jid);
- if ( !nick || (jidNick && !_tcsicmp(nick, jidNick)))
- setTString(hContact, "Nick", name);
-
- mir_free(jidNick);
- mir_free(nick);
- mir_free(name);
+ ptrT nick( db_get_tsa(hContact, m_szModuleName, "Nick"));
+ ptrT jidNick( JabberNickFromJID(jid));
+ if (!nick || (jidNick && !_tcsicmp(nick, jidNick)))
+ setTString(hContact, "Nick", ptrT( db_get_tsa(hContact, m_szModuleName, "FullName")));
}
if ( !hasFn)
JDeleteSetting(hContact, "FullName");
|