From 6984f16b63161b21ee76df0fb93ef39de4b925b1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 7 Jan 2021 15:30:27 +0300 Subject: we don't have to restore unread events from blocked accounts --- src/core/stdmsg/src/msgs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 562f6cf058..2070988e55 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -260,13 +260,16 @@ static void RestoreUnreadMessageAlerts(void) if (db_event_get(hDbEvent, &dbei)) continue; - if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) { + if (!dbei.markedRead() && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) { int windowAlreadyExists = Srmm_FindWindow(hContact) != nullptr; if (windowAlreadyExists) continue; char *szProto = Proto_GetBaseAccountName(hContact); - if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) + if (szProto == nullptr) + continue; + + if (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto))) autoPopup = true; if (autoPopup && !windowAlreadyExists) -- cgit v1.2.3