From dc1aa5930ea3ef174f1e47385e301c2415bea259 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Tue, 14 Oct 2014 08:28:52 +0000 Subject: =?UTF-8?q?VKontakte:=20sticker=20support=20part=202=20(sending=20?= =?UTF-8?q?stickers)=20=E2=80=93=20complete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@10779 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 17 +++++++++++++++++ protocols/VKontakte/src/vk_proto.cpp | 16 +++++++++++++++- protocols/VKontakte/src/vk_proto.h | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index e5f3b42194..8c15e75c20 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -545,4 +545,21 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG)); mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); +} + +char* CVkProto::GetStickerId (const char* Msg, int &stickerid) +{ + int iRes = 0; + char HeadMsg[32] = { 0 }; + char* retMsg = NULL; + iRes = sscanf(Msg, "[sticker:%d]", &stickerid); + if (iRes == 1){ + mir_snprintf(HeadMsg, 32, "[sticker:%d]", stickerid); + int retLen = strlen(HeadMsg); + if (retLenAddHeader("Content-Type", "application/x-www-form-urlencoded"); pReq->pUserInfo = new CVkSendMsgParam(hContact, msgId); Push(pReq); if (!m_bServerDelivery) ForkThread(&CVkProto::SendMsgAck, new TFakeAckParams(hContact, msgId)); + + if (retMsg){ + int _flags = flags | PREF_UTF; + Sleep(330); + SendMsg(hContact, _flags, retMsg); + } return msgId; } diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index df52642791..8659df0a07 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -322,6 +322,7 @@ struct CVkProto : public PROTO void SetMirVer(MCONTACT hContact, int platform); void SetSrmmReadStatus(MCONTACT hContact); void __cdecl ContactTypingThread(void *p); + char* GetStickerId(const char* Msg, int& stickerid); static UINT_PTR m_timer; -- cgit v1.2.3