diff options
author | George Hazan <ghazan@miranda.im> | 2018-12-21 15:59:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-12-21 15:59:56 +0300 |
commit | d30afe819abb03b139190c020db271888fab5eb1 (patch) | |
tree | ded6ed9860a4ea622a08450113400f9cbf9f47e9 /protocols/VKontakte/src/vk_search.cpp | |
parent | d78ec3edaa1f6c3d6cb80aa2767a38afda76bc25 (diff) |
attempt to unify AsyncHttpRequest in various protocols
Diffstat (limited to 'protocols/VKontakte/src/vk_search.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_search.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index 3796fbb530..9cba181b6f 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -46,11 +46,9 @@ void CVkProto::SearchBasicThread(void *id) debugLogA("CVkProto::OnSearchBasicThread");
if (!IsOnline())
return;
- AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnSearch)
- << WCHAR_PARAM("user_ids", (wchar_t *)id)
- << CHAR_PARAM("fields", "nickname, domain");
- pReq->pUserInfo = nullptr;
- Push(pReq);
+
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.get.json", true, &CVkProto::OnSearch)
+ << WCHAR_PARAM("user_ids", (wchar_t *)id) << CHAR_PARAM("fields", "nickname, domain"));
}
void CVkProto::SearchByMailThread(void *email)
@@ -58,10 +56,9 @@ void CVkProto::SearchByMailThread(void *email) debugLogA("CVkProto::OnSearchBasicThread");
if (!IsOnline())
return;
- AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/account.lookupContacts.json", true, &CVkProto::OnSearchByMail)
- << WCHAR_PARAM("contacts", (wchar_t *)email)
- << CHAR_PARAM("service", "email");
- Push(pReq);
+
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/account.lookupContacts.json", true, &CVkProto::OnSearchByMail)
+ << WCHAR_PARAM("contacts", (wchar_t *)email) << CHAR_PARAM("service", "email"));
}
void __cdecl CVkProto::SearchThread(void *p)
@@ -74,12 +71,10 @@ void __cdecl CVkProto::SearchThread(void *p) if (!IsOnline())
return;
- AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/users.search.json", true, &CVkProto::OnSearch)
+ Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/users.search.json", true, &CVkProto::OnSearch)
<< WCHAR_PARAM("q", (wchar_t *)arg)
<< CHAR_PARAM("fields", "nickname, domain")
- << INT_PARAM("count", 200);
- pReq->pUserInfo = p;
- Push(pReq);
+ << INT_PARAM("count", 200))->pUserInfo = p;
}
void CVkProto::FreeProtoShearchStruct(PROTOSEARCHBYNAME *pParam)
|