From 427359cbf083f5c5f709d68fd30bd08392ae57ca Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Thu, 27 Aug 2015 09:11:19 +0000 Subject: =?UTF-8?q?VKontakte:=20fix=20unneeded=20=E2=80=98mark=20as=20read?= =?UTF-8?q?=E2=80=99=20requests=20fix=20nick=20in=20forwarded=20messages?= =?UTF-8?q?=20code=20cleaning=20version=20bump?= 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@15040 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_history.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'protocols/VKontakte/src/vk_history.cpp') diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index b06784d39b..c7142ef726 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -126,14 +126,17 @@ void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int if (-1 == userID || userID == VK_FEED_USER) return; - CMStringA code; - - code.AppendFormat("var iOffset=%d;var iReqCount=%d;var userID=%d;var iTime=%d;var lastMid=%d;" + CMStringA code(FORMAT, "var iOffset=%d;var iReqCount=%d;var userID=%d;var iTime=%d;var lastMid=%d;" "var Hist=API.messages.getHistory({\"user_id\":userID,\"count\":iReqCount,\"offset\":iOffset});" - "var allCount=Hist.count;var ext=Hist.items.length;var index=0;" + "var ext=Hist.items.length;var index=0;" "while(ext!=0){if(Hist.items[index].date>iTime){if(Hist.items[index].id>lastMid)" "{index=index+1;ext=ext-1;}else ext=0;}else ext=0;};" - "var ret=Hist.items.slice(0,index); return{\"count\":index,\"datetime\":iTime,\"items\":ret,\"once\":%d,\"rcount\":iReqCount};", + "var ret=Hist.items.slice(0,index);" + "var FMsgs=ret@.fwd_messages;var Idx=0;var Uids=[];while(IdxpUserInfo; int iTime = jnResponse["datetime"].as_int(); const JSONNode &jnMsgs = jnResponse["items"]; + const JSONNode &jnFUsers = jnResponse["fwd_users"]; int iLastMsgId = getDword(param->hContact, "lastmsgid", -1); int count = 0; @@ -199,7 +203,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque const JSONNode &jnFwdMessages = jnMsg["fwd_messages"]; if (jnFwdMessages) { - CMString tszFwdMessages = GetFwdMessages(jnFwdMessages, m_iBBCForAttachments); + CMString tszFwdMessages = GetFwdMessages(jnFwdMessages, jnFUsers, m_iBBCForAttachments); if (!tszBody.IsEmpty()) tszFwdMessages = _T("\n") + tszFwdMessages; tszBody += tszFwdMessages; -- cgit v1.2.3