diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-09 18:21:23 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-09 18:22:12 +0300 |
commit | 5ef0585dbd3bfbc09093bc8f24f41e4ae2349c59 (patch) | |
tree | b76db3dc8173189591d65cc9a1a4e181331ca8f8 /src/core/stdmsg | |
parent | 6ef65121fed3c38c467238a08bf96bf98a23d7d8 (diff) |
SRMM: better support for group chats in database
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 13 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.h | 4 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 67401eea28..84ba0e1ca1 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -139,17 +139,13 @@ bool CMsgDialog::OnInitDialog() UpdateOptions();
UpdateStatusBar();
UpdateTitle();
-
- if (m_si->pMI->bDatabase) {
- FindFirstEvent();
- RemakeLog();
- }
+ UpdateChatLog();
}
else {
m_nickList.Hide();
m_splitterX.Hide();
- FindFirstEvent();
+ GetFirstEvent();
bool bUpdate = false;
DB::ECPTR pCursor(DB::EventsRev(m_hContact));
@@ -594,7 +590,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) return TRUE;
case HM_DBEVENTADDED:
- if (wParam == m_hContact) {
+ if (wParam == m_hContact && !isChat()) {
MEVENT hDbEvent = lParam;
if (m_hDbEventFirst == 0)
m_hDbEventFirst = hDbEvent;
@@ -1300,7 +1296,7 @@ void CMsgDialog::CloseTab() else SendMessage(m_hwndParent, WM_CLOSE, 0, 0);
}
-void CMsgDialog::FindFirstEvent()
+bool CMsgDialog::GetFirstEvent()
{
// This finds the first message to display, it works like shit
m_hDbEventFirst = db_event_firstUnread(m_hContact);
@@ -1339,6 +1335,7 @@ void CMsgDialog::FindFirstEvent() }
break;
}
+ return true;
}
void CMsgDialog::NotifyTyping(int mode)
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h index 0e9f38dead..8234296277 100644 --- a/src/core/stdmsg/src/msgs.h +++ b/src/core/stdmsg/src/msgs.h @@ -55,7 +55,6 @@ class CMsgDialog : public CSrmmBaseDialog friend class CTabbedWindow;
typedef CSrmmBaseDialog CSuper;
- void FindFirstEvent();
void Init(void);
void NotifyTyping(int mode);
void SetButtonsPos(void);
@@ -141,8 +140,6 @@ public: return ((CLogWindow *)m_pLog);
}
- MEVENT m_hDbEventFirst, m_hDbEventLast;
-
int m_avatarWidth = 0, m_avatarHeight = 0;
bool m_bIsAutoRTL = false;
@@ -156,6 +153,7 @@ public: }
void CloseTab() override;
+ bool GetFirstEvent() override;
bool IsActive() const override;
void LoadSettings() override;
void SetStatusText(const wchar_t *, HICON) override;
|