summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-25 13:18:47 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-25 13:18:47 +0300
commit9e6269ede3d41302ce7b9ca80916a033837bd897 (patch)
tree39c4b60a18f4a3f28c0469d70dea879296d04673
parent799519203a9a94d711f580c9c50a5d73466bdde6 (diff)
fixes #3459 (tabSRMM: Невозможно выключить фильтр событий)
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp9
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp8
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp19
-rw-r--r--plugins/TabSRMM/src/msgs.h1
4 files changed, 22 insertions, 15 deletions
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 107d55d855..16e23f7860 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -364,13 +364,15 @@ void Chat_SetFilters(SESSION_INFO *si)
CMsgDialog *pDlg = si->pDlg;
if (pDlg) {
- pDlg->m_iLogFilterFlags = Chat::iFilterFlags;
+ uint32_t dwFlags = Chat::iFilterFlags;
for (int i = 0; i < 32; i++) {
uint32_t dwBit = 1 << i;
if (dwMask & dwBit)
- pDlg->m_iLogFilterFlags = (dwFlags_local & dwBit) ? pDlg->m_iLogFilterFlags | dwBit : pDlg->m_iLogFilterFlags & ~dwBit;
+ dwFlags = (dwFlags_local & dwBit) ? dwFlags | dwBit : dwFlags & ~dwBit;
}
+
+ pDlg->SetFilter(dwFlags);
}
dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", GC_EVENT_HIGHLIGHT);
@@ -392,9 +394,6 @@ void Chat_SetFilters(SESSION_INFO *si)
if (dwMask & dwBit)
si->iTrayFlags = (dwFlags_local & dwBit) ? si->iTrayFlags | dwBit : si->iTrayFlags & ~dwBit;
}
-
- if (pDlg != nullptr && pDlg->m_iLogFilterFlags == 0)
- pDlg->m_bFilterEnabled = 0;
}
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex)
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 34bd740ff2..4d3ba096da 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -410,7 +410,7 @@ bool CMsgDialog::OnInitDialog()
if (m_bIsMeta)
m_cache->updateMeta();
- if (m_si) {
+ if (isChat()) {
m_si->pDlg = this;
Chat_SetFilters(m_si);
@@ -1125,22 +1125,20 @@ int CMsgDialog::Resizer(UTILRESIZECONTROL *urc)
if (m_panelStatusCX == 0)
m_panelStatusCX = 80;
- if (m_si) {
+ if (isChat()) {
if (m_si->iType != GCW_SERVER) {
m_nickList.Show(m_bNicklistEnabled);
Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, m_bNicklistEnabled ? SW_SHOW : SW_HIDE);
m_btnNickList.Enable(true);
- m_btnFilter.Enable(true);
+ m_btnFilter.Enable(m_iLogFilterFlags != 0);
if (m_si->iType == GCW_CHATROOM)
m_btnChannelMgr.Enable(m_si->pMI->bChanMgr);
}
else {
m_nickList.Hide();
Utils::showDlgControl(m_hwnd, IDC_SPLITTERX, SW_HIDE);
- }
- if (m_si->iType == GCW_SERVER) {
m_btnNickList.Enable(false);
m_btnFilter.Enable(false);
m_btnChannelMgr.Enable(false);
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index b7dd977c2d..95eedf6d2e 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -1978,6 +1978,19 @@ void TSAPI CleanTempFiles()
}
/////////////////////////////////////////////////////////////////////////////////////////
+
+void CMsgDialog::SetFilter(uint32_t dwFlags)
+{
+ m_iLogFilterFlags = dwFlags;
+
+ if (dwFlags == 0) {
+ m_bFilterEnabled = false;
+ m_btnFilter.Disable();
+ }
+ else m_btnFilter.Enable();
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// Sets a status bar text for a contact
void CMsgDialog::SetStatusText(const wchar_t *wszText, HICON hIcon)
@@ -2108,12 +2121,8 @@ INT_PTR CALLBACK CMsgDialog::FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
db_set_dw(pDlg->m_hContact, CHAT_MODULE, "TrayIconMask", dwMask);
}
- if (pDlg->m_bFilterEnabled) {
- if (pDlg->m_iLogFilterFlags == 0)
- pDlg->m_btnFilter.Click();
-
+ if (pDlg->m_bFilterEnabled)
pDlg->RedrawLog();
- }
}
DestroyWindow(hwndDlg);
break;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 6d05b1a25f..900a55b450 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -691,6 +691,7 @@ public:
void SaveSplitter(void);
void SelectContainer(void);
void SetDialogToType(void);
+ void SetFilter(uint32_t dwFlags);
void ShowPicture(bool showNewPic);
void SplitterMoved(int x, HWND hwnd);
void SwitchToContainer(const wchar_t *szNewName);