From 67e460ae2bf43109b9095c518cd2ede4e043e202 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 3 Oct 2013 22:25:13 +0000 Subject: 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 --- protocols/JabberG/src/jabber_events.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'protocols/JabberG/src/jabber_events.cpp') 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; } -- cgit v1.2.3