From af546e2f55ccb9a270ce4967d1942aebfcbbea19 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 Dec 2023 17:55:36 +0300 Subject: DB::EventInfo::wipeNotify - useful helper to hide blinking event both from database & contact list --- protocols/Facebook/src/server.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'protocols/Facebook/src/server.cpp') diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp index fcf1aacb2e..8601cd6db5 100644 --- a/protocols/Facebook/src/server.cpp +++ b/protocols/Facebook/src/server.cpp @@ -958,16 +958,15 @@ void FacebookProto::OnPublishReadReceipt(const JSONNode &root) uint32_t timestamp = _wtoi64(root["watermarkTimestampMs"].as_mstring()); for (MEVENT ev = db_event_firstUnread(pUser->hContact); ev != 0; ev = db_event_next(pUser->hContact, ev)) { - DBEVENTINFO dbei = {}; - if (db_event_get(ev, &dbei)) + DB::EventInfo dbei(ev); + if (!dbei) continue; if (dbei.timestamp > timestamp) break; if (dbei.flags & DBEF_SENT) - if (!dbei.markedRead()) - db_event_markRead(pUser->hContact, ev, true); + dbei.wipeNotify(ev); } } -- cgit v1.2.3