summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/globals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src/globals.cpp')
-rw-r--r--plugins/TabSRMM/src/globals.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 0af46fc489..8c11830517 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -446,18 +446,19 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
OBJLIST<MSavedEvent> arEvents(10, NumericKeySortT);
for (auto &hContact : Contacts()) {
+ if (Proto_GetBaseAccountName(hContact) == nullptr)
+ continue;
+
if (db_get_dw(hContact, "SendLater", "count", 0))
SendLater::addContact(hContact);
if (!Contact::IsGroupChat(hContact)) {
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DBEVENTINFO dbei = {};
- if (db_event_get(hDbEvent, &dbei))
- continue;
- if (Proto_GetBaseAccountName(hContact) == nullptr)
+ DB::EventInfo dbei(hDbEvent);
+ if (!dbei)
continue;
- if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE)
+ if (!dbei.markedRead() && dbei.isAlertable())
if (!Srmm_FindWindow(hContact))
arEvents.insert(new MSavedEvent(hContact, hDbEvent));
}