summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/NewStory/src/history_log.cpp7
-rw-r--r--src/mir_app/src/srmm_base.cpp12
2 files changed, 12 insertions, 7 deletions
diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp
index 3cfe682e46..a49b53eaff 100644
--- a/plugins/NewStory/src/history_log.cpp
+++ b/plugins/NewStory/src/history_log.cpp
@@ -40,6 +40,13 @@ public:
m_histCtrl->pMsgDlg = &m_pDlg;
m_histCtrl->m_hContact = m_pDlg.m_hContact;
WindowList_Add(g_hNewstoryLogs, m_hwnd, m_histCtrl->m_hContact);
+
+ DB::ECPTR pCursor(DB::Events(m_pDlg.m_hContact, db_event_firstUnread(m_pDlg.m_hContact)));
+ while (MEVENT hDbEvent = pCursor.FetchNext()) {
+ DB::EventInfo dbei(hDbEvent, false);
+ if (dbei && !dbei.bRead)
+ m_pDlg.MarkEventRead(dbei);
+ }
}
void Detach() override
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index 2268f3c30a..ebf192491d 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -762,13 +762,11 @@ bool CSrmmBaseDialog::IsSuitableEvent(const LOGINFO &lin) const
void CSrmmBaseDialog::MarkEventRead(const DB::EventInfo &dbei)
{
- if (dbei.bRead)
- return;
-
- if (m_bActive)
- doMarkEventRead(m_hContact, dbei.getEvent());
- else {
- m_arDisplayedEvents.push_back(dbei.getEvent());
+ if (!dbei.bRead) {
+ if (m_bActive)
+ doMarkEventRead(m_hContact, dbei.getEvent());
+ else
+ m_arDisplayedEvents.push_back(dbei.getEvent());
}
}