diff options
author | ElzorFox <elzorfox@ya.ru> | 2023-12-08 07:45:10 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2023-12-08 07:45:10 +0500 |
commit | cfe123df04b3317cc55d2405614d60496cd9bd3c (patch) | |
tree | 794e88d77efced166875be771955de12ec937ca1 | |
parent | 6030fd00aeed488ba04ddd6a213eb828ea50e814 (diff) |
VKontakte: forward only messages
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 881c0a3e86..94bebc7e78 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -51,15 +51,17 @@ int CVkProto::ForwardMsg(MCONTACT hContact, std::vector<MEVENT>& vForvardEvents, if (iForwardVKMessageCount == VK_MAX_FORWARD_MESSAGES)
break;
+ iForwardVKMessageCount++;
+
DB::EventInfo dbei(mEvnt);
- if (!dbei)
+ if (!dbei || dbei.eventType != EVENTTYPE_MESSAGE)
continue;
MCONTACT hForwardContact = db_event_getContact(mEvnt);
if (!Proto_IsProtoOnContact(hForwardContact, m_szModuleName)) {
CMStringW wszContactName = (dbei.flags & DBEF_SENT) ? getWStringA(hContact, "Nick", TranslateT("Me")) : Clist_GetContactDisplayName(hForwardContact);
-
+
wchar_t ttime[64];
time_t tTimestamp(dbei.timestamp);
_locale_t locale = _create_locale(LC_ALL, "");
@@ -75,13 +77,12 @@ int CVkProto::ForwardMsg(MCONTACT hContact, std::vector<MEVENT>& vForvardEvents, ttime,
dbei.pBlob ? ptrW(mir_utf8decodeW((char*)dbei.pBlob)) : L""
);
+
} else if (mir_strlen(dbei.szId) > 0) {
if (!szIds.IsEmpty())
szIds.AppendChar(',');
szIds += dbei.szId;
}
-
- iForwardVKMessageCount++;
}
ULONG uMsgId = ::InterlockedIncrement(&m_iMsgId);
|