summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Scriver/src/msgs.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp7
3 files changed, 8 insertions, 3 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 13b4b28b8b..30632696d1 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -251,7 +251,7 @@ static void RestoreUnreadMessageAlerts(void)
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei))
continue;
- if ((dbei.flags & (DBEF_SENT | DBEF_READ)) || !DbEventIsMessageOrCustom(&dbei))
+ if (dbei.markedRead() || !DbEventIsMessageOrCustom(&dbei) || !Proto_GetBaseAccountName(hContact))
continue;
int windowAlreadyExists = Srmm_FindWindow(hContact) != nullptr;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index e48a705a71..04dc12876e 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -467,6 +467,8 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
DBEVENTINFO dbei = {};
if (db_event_get(hDbEvent, &dbei))
continue;
+ if (Proto_GetBaseAccountName(hContact) == nullptr)
+ continue;
if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE) {
if (Srmm_FindWindow(hContact) != nullptr)
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)