summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-09-30 13:35:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-09-30 13:35:41 +0300
commitc90272a48520b1937624c0058f94b06e536f5ff6 (patch)
tree61eb1096c0565273a08a54a9f528b1260fc5bddb /protocols/VKontakte/src
parent5d016227186f7f272e2d423f0628e705187a2dc3 (diff)
code cleaning
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/vk_history.cpp10
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp3
2 files changed, 6 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 198c75fec4..93a1fcb25f 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
//////////////////////////// History services ///////////////////////////////////////////
-INT_PTR CVkProto::SvcEmptyServerHistory(WPARAM hContact, LPARAM lParam)
+INT_PTR CVkProto::SvcEmptyServerHistory(WPARAM hContact, LPARAM)
{
debugLogA("CVkProto::SvcEmptyServerHistory was called for %s", Clist_GetContactDisplayName(hContact));
@@ -232,6 +232,7 @@ void CVkProto::OnReceiveHistoryMessages(MHttpResponse *reply, AsyncHttpRequest *
const JSONNode &jnFUsers = jnResponse["fwd_users"];
VKMessageID_t iLastMsgId = ReadQSWord(param->hContact, "lastmsgid", -1);
time_t tLastReadMessageTime = 0;
+ MEVENT hDbEvent = 0;
int count = 0;
for (auto it = jnMsgs.rbegin(); it != jnMsgs.rend(); ++it) {
@@ -334,7 +335,7 @@ void CVkProto::OnReceiveHistoryMessages(MHttpResponse *reply, AsyncHttpRequest *
ProtoChainRecvMsg(hContact, dbei);
- MEVENT hDbEvent = db_event_getById(m_szModuleName, strcat(szMid, "_"));
+ hDbEvent = db_event_getById(m_szModuleName, strcat(szMid, "_"));
if (hDbEvent)
db_event_delete(hDbEvent, CDF_FROM_SERVER);
@@ -344,10 +345,9 @@ void CVkProto::OnReceiveHistoryMessages(MHttpResponse *reply, AsyncHttpRequest *
count++;
}
- WriteQSWord(param->hContact, "lastmsgid", iLastMsgId);
+ db_event_delivered(param->hContact, hDbEvent);
- if (g_bMessageState)
- CallService(MS_MESSAGESTATE_UPDATE, param->hContact, MRD_TYPE_DELIVERED);
+ WriteQSWord(param->hContact, "lastmsgid", iLastMsgId);
int once = jnResponse["once"].as_int();
int iRCount = jnResponse["rcount"].as_int();
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index b0858978d8..9f3aba3329 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -615,9 +615,8 @@ void CVkProto::OnReceiveDlgs(MHttpResponse *reply, AsyncHttpRequest *pReq)
bool bIsRead = (jnLastMessage["id"].as_int() <= jnConversation["in_read"].as_int());
if (bIsRead && bIsOut)
- CallService(MS_MESSAGESTATE_UPDATE, hContact, MRD_TYPE_DELIVERED);
+ db_event_delivered(hContact, 0);
}
-
if (m_vkOptions.iSyncHistoryMetod) {
VKMessageID_t iMessageId = jnLastMessage["id"].as_int();