diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-03 22:25:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-03 22:25:13 +0000 |
commit | 67e460ae2bf43109b9095c518cd2ede4e043e202 (patch) | |
tree | d4b6afb98a75fa4142b2980b792e92ee8f8fc11a /protocols/JabberG/src/jabber_events.cpp | |
parent | 784c2757e8c791b4c76a6e739f08b0fb92ec093a (diff) |
ptrT/A/W is used everywhere instead of DBVARIANT to read database strings
git-svn-id: http://svn.miranda-ng.org/main/trunk@6322 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_events.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_events.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index f71ee0dcc6..916fb3e9b7 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -36,23 +36,22 @@ int CJabberProto::OnContactDeleted(WPARAM wParam, LPARAM) return 0;
HANDLE hContact = (HANDLE)wParam;
- DBVARIANT dbv;
- if ( !getTString(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid", &dbv)) {
- if (ListGetItemPtr(LIST_ROSTER, dbv.ptszVal)) {
- if ( !_tcschr(dbv.ptszVal, _T('@'))) {
- TCHAR szStrippedJid[JABBER_MAX_JID_LEN];
- JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, SIZEOF(szStrippedJid));
- TCHAR *szDog = _tcschr(szStrippedJid, _T('@'));
- if (szDog && _tcsicmp(szDog + 1, dbv.ptszVal))
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), dbv.ptszVal) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
- }
-
- // Remove from roster, server also handles the presence unsubscription process.
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
- << XCHILD(_T("item")) << XATTR(_T("jid"), dbv.ptszVal) << XATTR(_T("subscription"), _T("remove")));
+ ptrT jid( getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
+ if (jid == NULL)
+ return 0;
+
+ if (ListGetItemPtr(LIST_ROSTER, jid)) {
+ if ( !_tcschr(jid, _T('@'))) {
+ TCHAR szStrippedJid[JABBER_MAX_JID_LEN];
+ JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, SIZEOF(szStrippedJid));
+ TCHAR *szDog = _tcschr(szStrippedJid, _T('@'));
+ if (szDog && _tcsicmp(szDog + 1, jid))
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), jid) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
}
- db_free(&dbv);
+ // Remove from roster, server also handles the presence unsubscription process.
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
+ << XCHILD(_T("item")) << XATTR(_T("jid"), jid) << XATTR(_T("subscription"), _T("remove")));
}
return 0;
}
|