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 /plugins/Scriver | |
parent | 6ef65121fed3c38c467238a08bf96bf98a23d7d8 (diff) |
SRMM: better support for group chats in database
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/msgdialog.cpp | 12 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 1 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 4 | ||||
-rw-r--r-- | plugins/Scriver/src/msgutils.cpp | 2 |
4 files changed, 8 insertions, 11 deletions
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);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index ffb08f4e3c..01ffec8586 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -109,6 +109,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0;
}
}
+
if (hwnd == nullptr || !IsWindowVisible(GetParent(hwnd))) {
wchar_t toolTip[256];
mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 0a2d30257e..7b92e8ce24 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -88,7 +88,6 @@ class CMsgDialog : public CSrmmBaseDialog friend INT_PTR CALLBACK InfobarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void ClearLog(void);
- bool FindFirstEvent(void);
HICON GetTabIcon(void);
void GetTitlebarIcon(struct TitleBarData *tbd);
void Init(void);
@@ -110,7 +109,7 @@ class CMsgDialog : public CSrmmBaseDialog bool m_bIncoming, m_bWindowCascaded;
- MEVENT m_hDbEventFirst, m_hDbEventLast, m_hDbUnreadEventFirst;
+ MEVENT m_hDbUnreadEventFirst;
int m_minLogBoxHeight, m_minEditBoxHeight;
int m_iShowUnread;
uint16_t m_wStatus;
@@ -173,6 +172,7 @@ public: void onType(CTimer *);
void CloseTab() override;
+ bool GetFirstEvent() override;
void LoadSettings() override;
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 68eaf56b40..01210cdcbd 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -36,7 +36,7 @@ void CMsgDialog::CloseTab() Close(); } -bool CMsgDialog::FindFirstEvent() +bool CMsgDialog::GetFirstEvent() { bool notifyUnread = false; |