summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-08-27 18:45:45 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-08-27 18:45:45 +0000
commitee46b2da0a78717c9ac1ca0739fe7f1f666377ce (patch)
tree894530e91c09ce757e3870e6ad41b5f01e542554 /protocols/VKontakte/src/vk_chats.cpp
parentd7d76938e05d7170668f4f950c40d65c47d1bb64 (diff)
VKontakte:
- fix for long chat messages; - fix for retrieveing user info on adding git-svn-id: http://svn.miranda-ng.org/main/trunk@10332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_chats.cpp')
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 0bb9873dea..7a83bd2853 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -335,9 +335,15 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam)
TCHAR *buf = NEWTSTR_ALLOCA(gch->ptszText);
rtrimt(buf);
UnEscapeChatTags(buf);
-
- Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.send.json", true, &CVkProto::OnSendChatMsg)
- << INT_PARAM("type", 1) << INT_PARAM("chat_id", cc->m_chatid) << TCHAR_PARAM("message", buf));
+
+ AsyncHttpRequest *pReq = new AsyncHttpRequest(this, REQUEST_POST, "/method/messages.send.json", true, &CVkProto::OnSendChatMsg)
+ << INT_PARAM("type", 1) << INT_PARAM("chat_id", cc->m_chatid);
+ pReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
+
+ CMStringA szBody(FORMAT, "message=%s", ptrA(mir_urlEncode(mir_utf8encodeT(buf))));
+ pReq->pData = mir_strdup(szBody);
+ pReq->dataLength = szBody.GetLength();
+ Push(pReq);
}
case GC_USER_LOGMENU: