diff options
Diffstat (limited to 'plugins/NewStory/src/history_log.cpp')
-rw-r--r-- | plugins/NewStory/src/history_log.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp index 4221a1a56e..a49b53eaff 100644 --- a/plugins/NewStory/src/history_log.cpp +++ b/plugins/NewStory/src/history_log.cpp @@ -1,6 +1,6 @@ /*
Copyright (c) 2005 Victor Pavlychko (nullbyte@sotline.net.ua)
-Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org)
+Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -37,12 +37,21 @@ public: 0, 0, rc.left - rc.right, rc.bottom - rc.top, m_pDlg.GetHwnd(), 0, m_pDlg.GetInst(), 0);
m_histCtrl = (NewstoryListData *)GetWindowLongPtr(m_hwnd, 0);
- m_histCtrl->SetDialog(&m_pDlg);
+ 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
{
- WindowList_Remove(g_hNewstoryLogs, m_pDlg.GetHwnd());
+ WindowList_Remove(g_hNewstoryLogs, m_hwnd);
::DestroyWindow(m_hwnd);
}
|