From 0479fc77ff072b34b01f17d51daf7569a80cf54c Mon Sep 17 00:00:00 2001 From: ElzorFox Date: Tue, 24 Jan 2017 15:41:25 +0500 Subject: =?UTF-8?q?VKontakte:=20set=20low=20priority=20for=20loading=20his?= =?UTF-8?q?tory=20requests=20rework=20loading=20groups=20to=20clist=20add?= =?UTF-8?q?=20=E2=80=98Load=20last=20messages=20when=20message=20window=20?= =?UTF-8?q?open=20and=20=20local=20history=20is=20empty=E2=80=99=20option?= =?UTF-8?q?=20(default=20true)=20version=20bump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/VKontakte/src/vk_history.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 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 4f4bfb15fc..8883238694 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -60,7 +60,7 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM, LPARAM) if (userID == VK_INVALID_USER || userID == VK_FEED_USER) continue; - + MEVENT hDBEvent = db_event_first(hContact); while (hDBEvent) { MEVENT hDBEventNext = db_event_next(hContact, hDBEvent); @@ -74,10 +74,10 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM, LPARAM) m_bNotifyForEndLoadingHistoryAllContact = m_bNotifyForEndLoadingHistory = true; debugLogA("CVkProto::SvcGetAllServerHistory for ID=%d m_iLoadHistoryTask=%d", userID, m_iLoadHistoryTask); } - + db_unset(hContact, m_szModuleName, "lastmsgid"); GetServerHistory(hContact, 0, MAXHISTORYMIDSPERONE, 0, 0); - + } return 1; @@ -132,9 +132,9 @@ void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int "var Jdx=0;var CFMsgs=parseInt(FMsgs[Idx].length);while(JdxpUserInfo = new CVkSendMsgParam(hContact, iLastMsgId, iOffset); } @@ -185,9 +185,9 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque if (!jnResponse) { if (!pReq->bNeedsRestart || m_bTerminated) { mir_cslock lck(m_csLoadHistoryTask); - if (m_iLoadHistoryTask > 0) + if (m_iLoadHistoryTask > 0) m_iLoadHistoryTask--; - + ptrW pwszNick(db_get_wsa(param->hContact, m_szModuleName, "Nick")); CMStringW str(FORMAT, TranslateT("Error loading message history for %s from server."), pwszNick); @@ -205,7 +205,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque return; } - int iTime = jnResponse["datetime"].as_int(); + int iTime = jnResponse["datetime"].as_int(); const JSONNode &jnMsgs = jnResponse["items"]; const JSONNode &jnFUsers = jnResponse["fwd_users"]; @@ -217,7 +217,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque const JSONNode &jnMsg = (*it); int mid = jnMsg["id"].as_int(); - if (iLastMsgId < mid) + if (iLastMsgId < mid) iLastMsgId = mid; char szMid[40]; @@ -226,8 +226,8 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque CMStringW wszBody(jnMsg["body"].as_mstring()); int datetime = jnMsg["date"].as_int(); int isOut = jnMsg["out"].as_int(); - int isRead = jnMsg["read_state"].as_int(); - int uid = jnMsg["user_id"].as_int(); + int isRead = jnMsg["read_state"].as_int(); + int uid = jnMsg["user_id"].as_int(); const JSONNode &jnFwdMessages = jnMsg["fwd_messages"]; if (jnFwdMessages) { @@ -289,7 +289,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque if (m_iLoadHistoryTask == 0 && m_bNotifyForEndLoadingHistoryAllContact) { MsgPopup(NULL, TranslateT("Loading messages for all contacts is completed."), TranslateT("Loading history")); - m_bNotifyForEndLoadingHistoryAllContact = m_bNotifyForEndLoadingHistory = false; + m_bNotifyForEndLoadingHistoryAllContact = m_bNotifyForEndLoadingHistory = false; } } -- cgit v1.2.3