diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-20 22:25:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-20 22:25:21 +0300 |
commit | 8635f4f728473b81a6f055813e25eaba3c4c5ce8 (patch) | |
tree | 289ae2168d3c7e473431a960804b24ae03fa8c66 /protocols/VKontakte/src | |
parent | 8d5867276a766c5447e4d4489f4649d7fb04ab72 (diff) |
creepy crutch removed that was adding message ids after the binary zero in message text
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 3 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_history.cpp | 6 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_messages.cpp | 9 |
3 files changed, 8 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 06656e43ad..5d1715779a 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -57,9 +57,6 @@ void CVkProto::AddFeedEvent(CVKNewsItem& vkNewsItem) PROTORECVEVENT recv = { 0 };
recv.timestamp = vkNewsItem.tDate;
recv.szMessage = pszBody;
- recv.lParam = 0;
- recv.pCustomData = nullptr;
- recv.cbCustomDataSize = 0;
if (m_vkOptions.bUseNonStandardNotifications) {
recv.flags = PREF_CREATEREAD;
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index c18fcd86af..cfeea5fbfa 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -293,9 +293,9 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque recv.timestamp = datetime;
recv.szMessage = pszBody;
recv.lParam = isOut;
- recv.pCustomData = szMid;
- recv.cbCustomDataSize = (int)mir_strlen(szMid);
- ProtoChainRecvMsg(hContact, &recv);
+ MEVENT hDbEvent = ProtoChainRecvMsg(hContact, &recv);
+ if (hDbEvent)
+ db_event_setId(m_szModuleName, hDbEvent, szMid);
if (isRead && isOut && datetime > tLastReadMessageTime)
tLastReadMessageTime = datetime;
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp index 62d6168b67..4e45bf7c3b 100644 --- a/protocols/VKontakte/src/vk_messages.cpp +++ b/protocols/VKontakte/src/vk_messages.cpp @@ -335,15 +335,14 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe recv.timestamp = bEdited ? datetime : (m_vkOptions.bUseLocalTime ? time(0) : datetime);
recv.szMessage = pszBody;
recv.lParam = isOut;
- recv.pCustomData = szMid;
- recv.cbCustomDataSize = (int)mir_strlen(szMid);
Sleep(100);
debugLogA("CVkProto::OnReceiveMessages mid = %d, datetime = %d, isOut = %d, isRead = %d, uid = %d", mid, datetime, isOut, isRead, uid);
+ MEVENT hDbEvent = 0;
if (!CheckMid(m_sendIds, mid)) {
debugLogA("CVkProto::OnReceiveMessages ProtoChainRecvMsg");
- ProtoChainRecvMsg(hContact, &recv);
+ hDbEvent = ProtoChainRecvMsg(hContact, &recv);
if (mid > getDword(hContact, "lastmsgid", -1))
setDword(hContact, "lastmsgid", mid);
if (!isOut)
@@ -353,8 +352,10 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe T2Utf pszAttach(wszAttachmentDescr);
recv.timestamp = time(0); // only local time
recv.szMessage = pszAttach;
- ProtoChainRecvMsg(hContact, &recv);
+ hDbEvent = ProtoChainRecvMsg(hContact, &recv);
}
+ if (hDbEvent)
+ db_event_setId(m_szModuleName, hDbEvent, szMid);
}
if (!mids.IsEmpty())
|