From 16dae6bd7df08d11cf9175239fb9b27f88c6f12c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Aug 2023 14:11:40 +0300 Subject: =?UTF-8?q?fixes=20#2373=20(NewStory:=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=8E=D1=82=20=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D1=80=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/IEView/src/ieview_logger.cpp | 30 +++++++++--------------------- plugins/NewStory/src/history_log.cpp | 12 ++++-------- plugins/Scriver/src/msglog.cpp | 2 +- plugins/TabSRMM/src/msglog.cpp | 2 +- plugins/TabSRMM/src/msgs.h | 2 +- 5 files changed, 16 insertions(+), 32 deletions(-) (limited to 'plugins') diff --git a/plugins/IEView/src/ieview_logger.cpp b/plugins/IEView/src/ieview_logger.cpp index 5ab19373d0..20391f34a3 100644 --- a/plugins/IEView/src/ieview_logger.cpp +++ b/plugins/IEView/src/ieview_logger.cpp @@ -27,13 +27,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ///////////////////////////////////////////////////////////////////////////////////////// // CIeviewLogWindow class -class CIeviewLogWindow : public CSrmmLogWindow +class CIeviewLogWindow : public CSimpleLogWindow { HWND m_hwnd = nullptr; public: CIeviewLogWindow(CMsgDialog &pDlg) : - CSrmmLogWindow(pDlg) + CSimpleLogWindow(pDlg) { } @@ -105,7 +105,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////// - void LogEvent(const LOGINFO *lin) + void LogChatEvent(const LOGINFO &lin) override { IEVIEWEVENTDATA ied = {}; ied.dwFlags = IEEDF_UNICODE_NICK; @@ -118,12 +118,12 @@ public: event.eventData = &ied; event.count = 1; - ied.szNick.w = lin->ptszNick; - ied.szText.w = lin->ptszText; - ied.time = lin->time; - ied.bIsMe = lin->bIsMe; + ied.szNick.w = lin.ptszNick; + ied.szText.w = lin.ptszText; + ied.time = lin.time; + ied.bIsMe = lin.bIsMe; - switch (lin->iType) { + switch (lin.iType) { case GC_EVENT_MESSAGE: ied.iType = IEED_GC_EVENT_MESSAGE; ied.dwData = IEEDD_GC_SHOW_NICK; @@ -167,19 +167,7 @@ public: ied.dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK; HandleIEEvent(0, LPARAM(&event)); } - - void LogEvents(const LOGINFO *lin) override - { - if (lin == nullptr) { - for (auto &it : m_pDlg.getChat()->arEvents) - LogEvent(it); - } - else LogEvent(lin); - - if (lin) - ScrollToBottom(); - } - + void Resize() override { RECT rcRichEdit; diff --git a/plugins/NewStory/src/history_log.cpp b/plugins/NewStory/src/history_log.cpp index 35f3b47c97..8c9775706b 100644 --- a/plugins/NewStory/src/history_log.cpp +++ b/plugins/NewStory/src/history_log.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" -class CNewStoryLogWindow : public CSrmmLogWindow +class CNewStoryLogWindow : public CSimpleLogWindow { HWND m_hwnd = nullptr; public: CNewStoryLogWindow(CMsgDialog &pDlg) : - CSrmmLogWindow(pDlg) + CSimpleLogWindow(pDlg) { } @@ -60,13 +60,9 @@ public: SendMessage(m_hwnd, NSM_ADDEVENTS, (LPARAM)&tmp, 0); } - void LogEvents(const LOGINFO *lin) override + void LogChatEvent(const LOGINFO &lin) override { - if (lin == nullptr) { - for (auto &it: m_pDlg.getChat()->arEvents) - SendMessage(m_hwnd, NSM_ADDCHATEVENT, (WPARAM)m_pDlg.getChat(), (LPARAM)it); - } - else SendMessage(m_hwnd, NSM_ADDCHATEVENT, (WPARAM)m_pDlg.getChat(), (LPARAM)lin); + SendMessage(m_hwnd, NSM_ADDCHATEVENT, (WPARAM)m_pDlg.getChat(), (LPARAM)&lin); } void Resize() override diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 5cc9a73cb5..4901a9f1fb 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -662,7 +662,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////// - void LogEvents(const LOGINFO *lin) override + void LogChatEvents(const LOGINFO *lin) override { if (m_rtf.GetHwnd() == nullptr) return; diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 8e3a2fab60..b5fc4ca97a 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1235,7 +1235,7 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DB::Ev ///////////////////////////////////////////////////////////////////////////////////////// -void CLogWindow::LogEvents(const LOGINFO *lin) +void CLogWindow::LogChatEvents(const LOGINFO *lin) { if (m_rtf.GetHwnd() == nullptr) return; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 1bd350f520..4aef4ccf63 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -692,7 +692,7 @@ public: void AppendUnicodeString(CMStringA &str, const wchar_t *pwszBuf) override; void Attach() override; void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override; - void LogEvents(const LOGINFO *lin) override; + void LogChatEvents(const LOGINFO *lin) override; void ScrollToBottom() override; void UpdateOptions() override; -- cgit v1.2.3