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 --- plugins/IEView/src/HTMLBuilder.cpp | 6 ++---- plugins/NewStory/src/history_array.cpp | 7 ++----- plugins/TabSRMM/src/msglog.cpp | 7 ++----- 3 files changed, 6 insertions(+), 14 deletions(-) (limited to 'plugins') diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 6a0f3a1d43..3c251572c4 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -204,10 +204,8 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) continue; } - if (!(dbei.flags & DBEF_SENT) && dbei.eventType == EVENTTYPE_MESSAGE) { - db_event_markRead(event->hContact, hDbEvent); - Clist_RemoveEvent(-1, hDbEvent); - } + if (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE) + dbei.wipeNotify(hDbEvent); if (!isDbEventShown(dbei)) { hDbEvent = db_event_next(event->hContact, hDbEvent); diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 3050e5af52..8ffa8c3106 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -469,11 +469,8 @@ void ItemData::load(int flags) void ItemData::markRead() { - if (!(dbe.flags & DBEF_SENT)) { - if (!dbe.markedRead()) - db_event_markRead(hContact, hEvent); - Clist_RemoveEvent(-1, hEvent); - } + if (!(dbe.flags & DBEF_SENT)) + dbe.wipeNotify(hEvent); } void ItemData::setText(HWND hwnd) diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 352063b2dd..2ae3bd5186 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -570,11 +570,8 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe BOOL isSent = (dbei.flags & DBEF_SENT); BOOL bIsStatusChangeEvent = IsStatusEvent(dbei.eventType); - if (!isSent && bIsStatusChangeEvent) { - if (!dbei.markedRead()) - db_event_markRead(streamData->hContact, streamData->hDbEvent); - Clist_RemoveEvent(-1, streamData->hDbEvent); - } + if (!isSent && bIsStatusChangeEvent) + dbei.wipeNotify(streamData->hDbEvent); CMStringW msg(ptrW(DbEvent_GetTextW(&dbei, CP_UTF8))); if (msg.IsEmpty()) -- cgit v1.2.3