From ee46b2da0a78717c9ac1ca0739fe7f1f666377ce Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Aug 2014 18:45:45 +0000 Subject: 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 --- protocols/VKontakte/src/vk_chats.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'protocols/VKontakte/src/vk_chats.cpp') 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: -- cgit v1.2.3