diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-12 11:59:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-12 11:59:23 +0000 |
commit | e528a508b7e307bd35b142b269a0bbd1b6813e89 (patch) | |
tree | e7e0a45738745420c563b141398e60d51558b46c /protocols/VKontakte/src/vk_proto.cpp | |
parent | 484267e90233bcef4ed9bda249053f5657b3974d (diff) |
VKontakte:
- completely rewritten schema of pushing requests;
- typed http parameters insted of old strings
git-svn-id: http://svn.miranda-ng.org/main/trunk@7613 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index b94497d54b..ec69b2a3ee 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -175,19 +175,12 @@ int CVkProto::SendMsg(HANDLE hContact, int flags, const char *msg) else
msg = mir_utf8encode(msg);
- char szID[40];
- _itoa(userID, szID, 10);
- HttpParam params[] = {
- { "type", "0" },
- { "uid", szID },
- { "message", szMsg },
- { "access_token", m_szAccessToken }
- };
-
ULONG msgId = ::InterlockedIncrement(&m_msgId);
- AsyncHttpRequest *pReq = PushAsyncHttpRequest(REQUEST_GET, "/method/messages.send.json", true, &CVkProto::OnSendMessage, SIZEOF(params), params);
+ AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.send.json", true, &CVkProto::OnSendMessage)
+ << INT_PARAM("type", 0) << INT_PARAM("uid", m_myUserId) << CHAR_PARAM("message", msg);
pReq->pData = (char*)hContact;
pReq->pUserInfo = (void*)msgId;
+ Push(pReq);
if (!m_bServerDelivery)
ForkThread(&CVkProto::SendMsgAck, new TFakeAckParams(hContact, msgId));
|