summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-17 20:43:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-17 20:43:20 +0300
commitac297d39f72433e077396a02c71526d50b157b17 (patch)
tree18d2fa80b717c9418d3456568e51998dce297e37 /plugins
parentf4ba44ddae2289b44e11e42dc934cb03462793bf (diff)
Chat: common code moved to mir_app
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/msgs.h1
-rw-r--r--plugins/Scriver/src/msgutils.cpp46
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp47
-rw-r--r--plugins/TabSRMM/src/msgs.h1
4 files changed, 4 insertions, 91 deletions
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index f9c893b528..d404942836 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -153,7 +153,6 @@ public:
void CloseTab() override;
void LoadSettings() override;
- void RedrawLog() override;
void ScrollToBottom() 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 8dff1c3e35..d69eb28703 100644
--- a/plugins/Scriver/src/msgutils.cpp
+++ b/plugins/Scriver/src/msgutils.cpp
@@ -218,40 +218,6 @@ void CMsgDialog::Reattach(HWND hwndContainer)
/////////////////////////////////////////////////////////////////////////////////////////
-static void __cdecl phase2(SESSION_INFO *si)
-{
- Thread_SetName("Scriver: phase2");
-
- Sleep(30);
- if (si && si->pDlg)
- si->pDlg->RedrawLog2();
-}
-
-void CMsgDialog::RedrawLog()
-{
- m_si->LastTime = 0;
- if (m_si->pLog) {
- LOGINFO *pLog = m_si->pLog;
- if (m_si->iEventCount > 60) {
- int index = 0;
- while (index < 59) {
- if (pLog->next == nullptr)
- break;
-
- pLog = pLog->next;
- if ((m_si->iType != GCW_CHATROOM && m_si->iType != GCW_PRIVMESS) || !m_bFilterEnabled || (m_iLogFilterFlags & pLog->iType) != 0)
- index++;
- }
- StreamInEvents(pLog, true);
- mir_forkThread<SESSION_INFO>(phase2, m_si);
- }
- else StreamInEvents(m_si->pLogEnd, true);
- }
- else ClearLog();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
void CMsgDialog::ScrollToBottom()
{
if (m_hwndIeview != nullptr) {
@@ -524,14 +490,6 @@ void CMsgDialog::UpdateOptions()
m_btnNickList.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bNicklistEnabled ? IDI_NICKLIST : IDI_NICKLIST2));
m_btnFilter.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bFilterEnabled ? IDI_FILTER : IDI_FILTER2));
- m_btnBold.Enable(m_si->pMI->bBold);
- m_btnItalic.Enable(m_si->pMI->bItalics);
- m_btnUnderline.Enable(m_si->pMI->bUnderline);
- m_btnColor.Enable(m_si->pMI->bColor);
- m_btnBkColor.Enable(m_si->pMI->bBkgColor);
- if (m_si->iType == GCW_CHATROOM)
- m_btnChannelMgr.Enable(m_si->pMI->bChanMgr);
-
UpdateStatusBar();
UpdateTitle();
FixTabIcons();
@@ -565,8 +523,8 @@ void CMsgDialog::UpdateOptions()
InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
}
m_message.SendMsg(EM_REQUESTRESIZE, 0, 0);
- Resize();
- RedrawLog2();
+
+ CSuper::UpdateOptions();
}
void CMsgDialog::UpdateStatusBar()
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 64010ae736..e53df65031 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -1224,39 +1224,6 @@ void CMsgDialog::RemakeLog()
/////////////////////////////////////////////////////////////////////////////////////////
-static void __cdecl phase2(SESSION_INFO *si)
-{
- Thread_SetName("TabSRMM: phase2");
-
- Sleep(30);
- if (si && si->pDlg)
- si->pDlg->RedrawLog2();
-}
-
-void CMsgDialog::RedrawLog()
-{
- m_si->LastTime = 0;
- if (m_si->pLog) {
- LOGINFO *pLog = m_si->pLog;
- if (m_si->iEventCount > 60) {
- int index = 0;
- while (index < 59) {
- if (pLog->next == nullptr)
- break;
- pLog = pLog->next;
- if ((m_si->iType != GCW_CHATROOM && m_si->iType != GCW_PRIVMESS) || !m_bFilterEnabled || (m_iLogFilterFlags & pLog->iType) != 0)
- index++;
- }
- StreamInEvents(pLog, TRUE);
- mir_forkThread<SESSION_INFO>(phase2, m_si);
- }
- else StreamInEvents(m_si->pLogEnd, TRUE);
- }
- else ClearLog();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
void CMsgDialog::ReplayQueue()
{
for (int i = 0; i < m_iNextQueuedEvent; i++)
@@ -1980,16 +1947,6 @@ void CMsgDialog::UpdateNickList()
void CMsgDialog::UpdateOptions()
{
- MODULEINFO *pInfo = m_si ? m_si->pMI : nullptr;
- if (pInfo) {
- m_btnBold.Enable(pInfo->bBold);
- m_btnItalic.Enable(pInfo->bItalics);
- m_btnUnderline.Enable(pInfo->bUnderline);
- m_btnColor.Enable(pInfo->bColor);
- m_btnBkColor.Enable(pInfo->bBkgColor);
- if (m_si->iType == GCW_CHATROOM)
- m_btnChannelMgr.Enable(pInfo->bChanMgr);
- }
m_log.SendMsg(EM_SETBKGNDCOLOR, 0, db_get_dw(0, FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
DM_InitRichEdit();
@@ -1999,8 +1956,8 @@ void CMsgDialog::UpdateOptions()
InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE);
m_btnFilter.SendMsg(BUTTONSETOVERLAYICON, (LPARAM)(m_bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
- Resize();
- RedrawLog2();
+
+ CSuper::UpdateOptions();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 0a1c2deff6..8ef3641d43 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -460,7 +460,6 @@ public:
void AddLog() override;
void CloseTab() override;
void LoadSettings() override;
- void RedrawLog() override;
void ScrollToBottom() override;
void SetStatusText(const wchar_t *, HICON) override;
void ShowFilterMenu() override;