summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_chats.cpp
diff options
context:
space:
mode:
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: