summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-09 18:21:23 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-09 18:22:12 +0300
commit5ef0585dbd3bfbc09093bc8f24f41e4ae2349c59 (patch)
treeb76db3dc8173189591d65cc9a1a4e181331ca8f8 /plugins/TabSRMM/src
parent6ef65121fed3c38c467238a08bf96bf98a23d7d8 (diff)
SRMM: better support for group chats in database
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp2
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp3
-rw-r--r--plugins/TabSRMM/src/msgs.h3
5 files changed, 8 insertions, 12 deletions
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index f704717da6..ad5df5726d 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -1081,7 +1081,7 @@ void CMsgDialog::DM_EventAdded(WPARAM, LPARAM lParam)
}
m_cache->updateStats(TSessionStats::UPDATE_WITH_LAST_RCV, 0);
- if (hDbEvent != m_hDbEventFirst || isChat())
+ if (hDbEvent != m_hDbEventFirst)
StreamEvents(hDbEvent, 1, 1);
else
RemakeLog();
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index ca1e9c3272..9b776b88ab 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -416,7 +416,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
if (pTargetContainer == nullptr || !g_plugin.bHideOnClose || IsWindowVisible(pTargetContainer->m_hwnd))
return 0;
- WINDOWPLACEMENT wp = { 0 };
+ WINDOWPLACEMENT wp = {};
wp.length = sizeof(wp);
GetWindowPlacement(pTargetContainer->m_hwnd, &wp);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 0ea8c25470..67d48d5545 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -573,14 +573,10 @@ bool CMsgDialog::OnInitDialog()
m_hTabIcon = m_hTabStatusIcon;
UpdateNickList();
-
- if (m_si->pMI->bDatabase) {
- FindFirstEvent();
- RemakeLog();
- }
+ UpdateChatLog();
}
else {
- FindFirstEvent();
+ GetFirstEvent();
DM_OptionsApplied();
@@ -2494,7 +2490,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case HM_DBEVENTADDED:
// this is called whenever a new event has been added to the database.
// this CAN be posted (some sanity checks required).
- if (this)
+ if (this && !isChat())
DM_EventAdded(m_hContact, lParam);
return 0;
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index f2045b77df..06501884f7 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -452,7 +452,7 @@ void CMsgDialog::EnableSending(bool bMode) const
/////////////////////////////////////////////////////////////////////////////////////////
-void CMsgDialog::FindFirstEvent()
+bool CMsgDialog::GetFirstEvent()
{
int historyMode = g_plugin.getByte(m_hContact, SRMSGSET_LOADHISTORY, -1);
if (historyMode == -1)
@@ -506,6 +506,7 @@ void CMsgDialog::FindFirstEvent()
}
break;
}
+ return true;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 382ad1f54d..01ad889666 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -456,7 +456,6 @@ class CMsgDialog : public CSrmmBaseDialog
void CalcDynamicAvatarSize(BITMAP *bminfo);
void DetermineMinHeight(void);
BOOL DoRtfToTags(CMStringW &pszText) const;
- void FindFirstEvent(void);
int FindRTLLocale(void);
void FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei);
void FlashTab(bool bInvertMode);
@@ -558,7 +557,6 @@ public:
uint32_t m_dwUnread;
HANDLE m_hTheme, m_hThemeIP, m_hThemeToolbar;
HICON m_hXStatusIcon, m_hTabStatusIcon, m_hTabIcon, m_iFlashIcon, m_hTaskbarIcon, m_hClientIcon;
- MEVENT m_hDbEventFirst, m_hDbEventLast;
HANDLE m_hTimeZone;
MEVENT* m_hHistoryEvents;
time_t m_lastEventTime;
@@ -635,6 +633,7 @@ public:
void AddLog() override;
void CloseTab() override;
+ bool GetFirstEvent() override;
bool IsActive() const override;
void LoadSettings() override;
void SetStatusText(const wchar_t *, HICON) override;