summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-03-30 22:06:05 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-03-30 22:06:05 +0300
commit0106b105c7ac842eec10c5683be41cb50fd2e26c (patch)
tree062f27951606187a00b252784ebd0f39ce7e12b1 /plugins/TabSRMM
parent357540d5d8f0e67a2b3efdef7bc40c8db91fccf8 (diff)
fix for #3471 applied to StdMsg & Scriver
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/chat.h3
-rw-r--r--plugins/TabSRMM/src/chat_main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_manager.cpp11
-rw-r--r--plugins/TabSRMM/src/chat_options.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp42
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp3
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp12
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
8 files changed, 8 insertions, 69 deletions
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h
index 08a4bf6a8d..0c4a88a64b 100644
--- a/plugins/TabSRMM/src/chat.h
+++ b/plugins/TabSRMM/src/chat.h
@@ -100,8 +100,6 @@ SESSION_INFO* SM_FindSessionByHWND(HWND h);
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h);
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
-BOOL SM_ReconfigureFilters();
-
void OnCreateNick(const SESSION_INFO *si, const LOGINFO *lin, CMStringW &wszNick);
int UM_CompareItem(const USERINFO *u1, const USERINFO *u2);
@@ -110,7 +108,6 @@ int UM_CompareItem(const USERINFO *u1, const USERINFO *u2);
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix);
bool IsHighlighted(SESSION_INFO *si, GCEVENT *pszText);
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex);
-void Chat_SetFilters(SESSION_INFO *si);
BOOL DoPopup(SESSION_INFO *si, GCEVENT* gce);
int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoName, wchar_t* pszRoomName, COLORREF crBkg, const wchar_t* fmt, ...);
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp
index 395a51a05e..c095cc94e0 100644
--- a/plugins/TabSRMM/src/chat_main.cpp
+++ b/plugins/TabSRMM/src/chat_main.cpp
@@ -133,8 +133,6 @@ static void OnLoadSettings()
if (g_Settings.SelectionBGBrush)
DeleteObject(g_Settings.SelectionBGBrush);
g_Settings.SelectionBGBrush = CreateSolidBrush(g_Settings.nickColors[5]);
-
- SM_ReconfigureFilters();
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp
index d8bef4f461..da423141cd 100644
--- a/plugins/TabSRMM/src/chat_manager.cpp
+++ b/plugins/TabSRMM/src/chat_manager.cpp
@@ -72,17 +72,6 @@ int UM_CompareItem(const USERINFO *u1, const USERINFO *u2)
// Keeps track of all sessions and its windows
//---------------------------------------------------
-BOOL SM_ReconfigureFilters()
-{
- for (auto &si : g_chatApi.arSessions) {
- Chat_SetFilters(si);
- if (si->pDlg)
- si->pDlg->RedrawLog();
- }
-
- return TRUE;
-}
-
SESSION_INFO* SM_FindSessionByHWND(HWND hWnd)
{
for (auto &si : g_chatApi.arSessions)
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp
index 710a46a0af..93c78a9817 100644
--- a/plugins/TabSRMM/src/chat_options.cpp
+++ b/plugins/TabSRMM/src/chat_options.cpp
@@ -471,7 +471,7 @@ protected:
g_chatApi.MM_IconsChanged();
g_chatApi.MM_FontsChanged();
Chat_UpdateOptions();
- SM_ReconfigureFilters();
+ Chat_ReconfigureFilters();
PluginConfig.reloadSettings();
CacheMsgLogIcons();
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 7ad4525575..49063bf0a4 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -352,48 +352,6 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight
}
/////////////////////////////////////////////////////////////////////////////////////////
-// set all filters and notification config for a session
-// uses per channel mask + filterbits, default config as backup
-
-void Chat_SetFilters(SESSION_INFO *si)
-{
- bool bEnabled = db_get_b(si->hContact, CHAT_MODULE, "FilterEnabled") != 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;
- if (dwMask & dwBit)
- dwFlags = (dwFlags_local & dwBit) ? dwFlags | dwBit : dwFlags & ~dwBit;
- }
-
- pDlg->m_iLogFilterFlags = dwFlags;
- }
-
- 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++) {
- uint32_t dwBit = 1 << i;
- if (dwMask & dwBit)
- si->iPopupFlags = (dwFlags_local & dwBit) ? si->iPopupFlags | dwBit : si->iPopupFlags & ~dwBit;
- }
-
- dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconFlags", GC_EVENT_HIGHLIGHT);
- dwMask = (bEnabled) ? db_get_dw(si->hContact, CHAT_MODULE, "TrayIconMask", 0) : 0;
-
- si->iTrayFlags = Chat::iTrayIconFlags;
- for (int i = 0; i < 32; i++) {
- uint32_t dwBit = 1 << i;
- if (dwMask & dwBit)
- si->iTrayFlags = (dwFlags_local & dwBit) ? si->iTrayFlags | dwBit : si->iTrayFlags & ~dwBit;
- }
-}
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex)
{
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 75e977a799..5451beac4d 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -350,7 +350,6 @@ void CMsgDialog::Init()
m_szProto = Proto_GetBaseAccountName(m_hContact);
m_autoClose = CLOSE_ON_CANCEL;
m_forceResizable = true;
- m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0;
// refresh cache data for this contact
m_cache = CContactCache::getContactCache(m_hContact);
@@ -997,8 +996,6 @@ void CMsgDialog::onClick_Filter(CCtrlButton *pButton)
m_bFilterEnabled = !m_bFilterEnabled;
UpdateFilterButton();
- db_set_b(m_si->hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled);
- Chat_SetFilters(m_si);
if (m_bFilterEnabled && !g_chatApi.bRightClickFilter)
ShowFilterMenu();
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 7fd05e5861..abf577fd40 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -2023,14 +2023,14 @@ INT_PTR CALLBACK CMsgDialog::FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wPara
pDlg = (CMsgDialog *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
- uint32_t dwMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "FilterMask", 0);
- uint32_t dwFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "FilterFlags", 0);
+ uint32_t dwMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "FilterMask");
+ uint32_t dwFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "FilterFlags");
- uint32_t dwPopupMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "PopupMask", 0);
- uint32_t dwPopupFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "PopupFlags", 0);
+ uint32_t dwPopupMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "PopupMask");
+ uint32_t dwPopupFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "PopupFlags");
- uint32_t dwTrayMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "TrayIconMask", 0);
- uint32_t dwTrayFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "TrayIconFlags", 0);
+ uint32_t dwTrayMask = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "TrayIconMask");
+ uint32_t dwTrayFlags = db_get_dw(pDlg->m_hContact, CHAT_MODULE, "TrayIconFlags");
for (int i = 0; i < _countof(_eventorder); i++) {
CheckDlgButton(hwndDlg, IDC_1 + i, dwMask & _eventorder[i] ? (dwFlags & _eventorder[i] ? BST_CHECKED : BST_UNCHECKED) : BST_INDETERMINATE);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 2fb0e7fe9e..86b0caf93a 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -1327,7 +1327,7 @@ void CLogWindow::LogEvents(LOGINFO *lin, bool bRedraw)
if (m_rtf.GetHwnd() == nullptr || lin == nullptr || si == nullptr)
return;
- if (!bRedraw && m_pDlg.AllowTyping() && m_pDlg.m_bFilterEnabled && (m_pDlg.m_iLogFilterFlags & lin->iType) == 0)
+ if (!bRedraw && m_pDlg.AllowTyping() && !(m_pDlg.m_iLogFilterFlags & lin->iType))
return;
bool bFlag = false, bDoReplace, bAtBottom = AtBottom();