diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 41 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_groupchat.cpp | 3 |
2 files changed, 17 insertions, 27 deletions
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index c84b4fdfd3..fb54c36990 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -147,39 +147,30 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, HANDL if (cws->value.type != DBVT_DELETED && !(cws->value.type==DBVT_BYTE && cws->value.bVal==0))
return;
- DBVARIANT jid, dbv;
- if (getTString(hContact, "jid", &jid))
+ ptrT jid( getTStringA(hContact, "jid"));
+ if (jid == NULL)
return;
- TCHAR *nick;
- Log("Add %S permanently to list", jid.pszVal);
- 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(jid.ptszVal);
- if (nick == NULL) {
- db_free(&jid);
+ Log("Add %S permanently to list", jid);
+ ptrT nick( db_get_tsa(hContact, "CList", "MyHandle"));
+ if (nick == NULL)
+ nick = getTStringA(hContact, "Nick");
+ if (nick == NULL)
+ nick = JabberNickFromJID(jid);
+ if (nick == NULL)
return;
- }
- if ( !db_get_ts(hContact, "CList", "Group", &dbv)) {
- AddContactToRoster(jid.ptszVal, nick, dbv.ptszVal);
- db_free(&dbv);
- }
- else AddContactToRoster(jid.ptszVal, nick, NULL);
+ AddContactToRoster(jid, nick, ptrT( db_get_tsa(hContact, "CList", "Group")));
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), jid.ptszVal) << XATTR(_T("type"), _T("subscribe")));
+ HXML xPresence = XmlNode(_T("presence")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("subscribe"));
+ ptrT myNick( getTStringA(NULL, "Nick"));
+ if (myNick != NULL)
+ xPresence << XCHILD(_T("nick"), nick) << XATTR(_T("xmlns"), JABBER_FEAT_NICK);
+ m_ThreadInfo->send(xPresence);
- SendGetVcard(jid.ptszVal);
+ SendGetVcard(jid);
- mir_free(nick);
db_unset(hContact, "CList", "Hidden");
- db_free(&jid);
}
int __cdecl CJabberProto::OnDbSettingChanged(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index e5a77e7d84..bb5921e1c3 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -514,8 +514,7 @@ void CJabberDlgGcJoin::OnInitDialog() m_proto->ComboLoadRecentStrings(m_hwnd, IDC_SERVER, "joinWnd_rcSvr");
int i;
- for (i=0; i < 5; i++)
- {
+ for (i=0; i < 5; i++) {
TCHAR jid[JABBER_MAX_JID_LEN];
JabberGcRecentInfo info(m_proto);
if ( !info.loadRecent(i))
|