summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-11 16:35:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-11 16:35:27 +0300
commit7478fc7427143486c6f2ecf552b460c78fb44e82 (patch)
treea545d4148fb2ead55f33a5e337488b406048276c
parent1391158fa89b754de6940fafa40ddb1c62b328e7 (diff)
ICQ-WIM: there's no reason to import the same old messages again & again...
-rw-r--r--protocols/ICQ-WIM/src/server.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index b10f6c1cd5..465cb052be 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -438,6 +438,7 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo
return;
}
+ // filter out file transfers
bool bIsOutgoing = it["outgoing"].as_bool();
if (!bCreateRead && !bIsOutgoing && wszText.Left(26) == L"https://files.icq.net/get/") {
CMStringW wszUrl(wszText.Mid(26));
@@ -458,7 +459,14 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo
return;
}
- debugLogA("Adding message %d:%s (CR=%d)", hContact, szMsgId.c_str(), bCreateRead);
+ // suppress notifications for already loaded/processed messages
+ __int64 storedLastId = getId(hContact, DB_KEY_LASTMSGID);
+ if (msgId <= storedLastId) {
+ debugLogA("Parsing old/processed message with id %lld < %lld, setting CR to true", msgId, storedLastId);
+ bCreateRead = true;
+ }
+
+ debugLogA("Adding message %d:%lld (CR=%d)", hContact, msgId, bCreateRead);
ptrA szUtf(mir_utf8encodeW(wszText));