diff options
author | George Hazan <george.hazan@gmail.com> | 2013-10-02 19:38:44 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-10-02 19:38:44 +0000 |
commit | 8fecb411c56387ef6db40abe96b8c935fddc6083 (patch) | |
tree | 3aee9abef3610ab248bba34af1bd4878038d130f /protocols/JabberG/src/jabber_search.cpp | |
parent | f7e58cf1bf50928ae22ffbdd9de99844407d5780 (diff) |
atavism extincted: old nasty IQ handler mechanism
git-svn-id: http://svn.miranda-ng.org/main/trunk@6312 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_search.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_search.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 21819e80d4..e024ee28d6 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -131,7 +131,7 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat) ////////////////////////////////////////////////////////////////////////////////
// Available search field request result handler (XEP-0055. Examples 2, 7)
-void CJabberProto::OnIqResultGetSearchFields(HXML iqNode)
+void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo *pInfo)
{
if ( !searchHandleDlg)
return;
@@ -295,7 +295,7 @@ TCHAR* CopyKey(TCHAR* key) ////////////////////////////////////////////////////////////////////////////////
// Search field request result handler (XEP-0055. Examples 3, 8)
-void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode)
+void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo *pInfo)
{
const TCHAR *type;
int id;
@@ -467,10 +467,9 @@ int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData * dat) searchHandleDlg = hwndDlg;
- int iqId = SerialNext();
- IqAdd(iqId, IQ_PROC_GETSEARCHFIELDS, &CJabberProto::OnIqResultGetSearchFields);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, szServerName) << XQUERY(_T("jabber:iq:search")));
- return iqId;
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultGetSearchFields, JABBER_IQ_TYPE_GET, szServerName);
+ m_ThreadInfo->send( XmlNodeIq(pInfo) << XQUERY(_T("jabber:iq:search")));
+ return pInfo->GetIqId();
}
static void JabberSearchAddUrlToRecentCombo(HWND hwndDlg, const TCHAR *szAddr)
@@ -734,8 +733,8 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg) GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, SIZEOF(szServerName));
// formating query
- int iqId = SerialNext();
- XmlNodeIq iq(_T("set"), iqId, szServerName);
+ CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultAdvancedSearch, JABBER_IQ_TYPE_SET, szServerName);
+ XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(_T("jabber:iq:search"));
if (m_tszSelectedLang)
@@ -759,11 +758,8 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg) } } }
if (fRequestNotEmpty) {
- // register search request result handler
- IqAdd(iqId, IQ_PROC_GETSEARCH, &CJabberProto::OnIqResultAdvancedSearch);
- // send request
m_ThreadInfo->send(iq);
- return (HWND)iqId;
+ return (HWND)pInfo->GetIqId();
}
return 0;
}
|