From 5ef0585dbd3bfbc09093bc8f24f41e4ae2349c59 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 Feb 2023 18:21:23 +0300 Subject: SRMM: better support for group chats in database --- plugins/Scriver/src/msgdialog.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'plugins/Scriver/src/msgdialog.cpp') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 3618b9a1aa..8f7a405723 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -236,20 +236,16 @@ bool CMsgDialog::OnInitDialog() UpdateStatusBar(); UpdateTitle(); UpdateNickList(); + UpdateChatLog(); m_pParent->AddChild(this); PopupWindow(false); - - if (m_si->pMI->bDatabase) { - FindFirstEvent(); - SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); - } } else { m_nickList.Hide(); m_splitterX.Hide(); - bool notifyUnread = FindFirstEvent(); + bool notifyUnread = GetFirstEvent(); m_pParent->AddChild(this); @@ -1170,7 +1166,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) break; case HM_DBEVENTADDED: - if (wParam == m_hContact) { + if (wParam == m_hContact && !isChat()) { MEVENT hDbEvent = lParam; DBEVENTINFO dbei = {}; db_event_get(hDbEvent, &dbei); @@ -1194,7 +1190,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) PopupWindow(true); } - if (isChat() || (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0)) + if (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0) m_pLog->LogEvents(hDbEvent, 1, 1); else SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); -- cgit v1.2.3