summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-29 19:23:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-29 19:24:04 +0300
commit2d2fa625324f872b96f671ff7848f0146640413f (patch)
treec9cff5b1c88a5e2756f69c4b7f5163af6d50d255
parent0dee3af505998928978c46d2edb8a6013f933647 (diff)
fixes #3469 (tabSRMM: global filter settings aren't applied if a filter is disabled)
-rw-r--r--plugins/TabSRMM/src/chat_log.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_manager.cpp5
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp9
3 files changed, 9 insertions, 7 deletions
diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp
index 73884d4e84..950fe19d77 100644
--- a/plugins/TabSRMM/src/chat_log.cpp
+++ b/plugins/TabSRMM/src/chat_log.cpp
@@ -323,7 +323,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
// ### RTF BODY (one iteration per event that should be streamed in)
while (lin) {
// filter
- if ((si->iType != GCW_CHATROOM && si->iType != GCW_PRIVMESS) || !si->pDlg->m_bFilterEnabled || (si->pDlg->m_iLogFilterFlags & lin->iType) != 0) {
+ if ((si->iType != GCW_CHATROOM && si->iType != GCW_PRIVMESS) || (si->pDlg->m_iLogFilterFlags & lin->iType) != 0) {
if (lin->next != nullptr)
str.Append("\\par ");
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp
index bc540bed44..d8bef4f461 100644
--- a/plugins/TabSRMM/src/chat_manager.cpp
+++ b/plugins/TabSRMM/src/chat_manager.cpp
@@ -74,8 +74,11 @@ int UM_CompareItem(const USERINFO *u1, const USERINFO *u2)
BOOL SM_ReconfigureFilters()
{
- for (auto &si : g_chatApi.arSessions)
+ for (auto &si : g_chatApi.arSessions) {
Chat_SetFilters(si);
+ if (si->pDlg)
+ si->pDlg->RedrawLog();
+ }
return TRUE;
}
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 16e23f7860..ecba3d95b2 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -359,12 +359,11 @@ void Chat_SetFilters(SESSION_INFO *si)
{
bool bEnabled = db_get_b(si->hContact, CHAT_MODULE, "FilterEnabled") != 0;
- uint32_t dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
- uint32_t dwMask = (bEnabled) ? db_get_dw(si->hContact, CHAT_MODULE, "FilterMask") : 0;
-
CMsgDialog *pDlg = si->pDlg;
if (pDlg) {
uint32_t dwFlags = Chat::iFilterFlags;
+ uint32_t dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "FilterFlags", GC_EVENT_ALL);
+ uint32_t dwMask = (bEnabled) ? db_get_dw(si->hContact, CHAT_MODULE, "FilterMask") : 0;
for (int i = 0; i < 32; i++) {
uint32_t dwBit = 1 << i;
@@ -375,8 +374,8 @@ void Chat_SetFilters(SESSION_INFO *si)
pDlg->SetFilter(dwFlags);
}
- dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", GC_EVENT_HIGHLIGHT);
- dwMask = (bEnabled) ? db_get_dw(si->hContact, CHAT_MODULE, "PopupMask", 0) : 0;
+ uint32_t dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", GC_EVENT_HIGHLIGHT);
+ uint32_t dwMask = (bEnabled) ? db_get_dw(si->hContact, CHAT_MODULE, "PopupMask", 0) : 0;
si->iPopupFlags = Chat::iPopupFlags;
for (int i = 0; i < 32; i++) {