summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-03-30 15:06:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-03-30 15:06:19 +0000
commit84a693e4ea7d3072b2188152736aca7c8b885863 (patch)
tree0ccea849066ca3cd2836811d419d519d5d1d9666 /plugins/TabSRMM/src
parent5af8f1dae14233cb203d78da7b5b1a286272cc6a (diff)
fix for the correct restoring of filter in tabSRMM
git-svn-id: http://svn.miranda-ng.org/main/trunk@12551 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp24
3 files changed, 21 insertions, 11 deletions
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 8b9248c5bd..e41c697c29 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -44,6 +44,8 @@ static void OnAddLog(SESSION_INFO *si, int isOk)
static void OnCreateSession(SESSION_INFO *si, MODULEINFO *mi)
{
+ si->bFilterEnabled = db_get_b(si->hContact, "Chat", "FilterEnabled", M.GetByte("Chat", "FilterEnabled", 0));
+
Chat_SetFilters(si);
if (mi) {
mi->idleTimeStamp = time(0);
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index b895e70991..7c77f7da97 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -127,7 +127,8 @@ static FontOptionsList IP_fontOptionsList[] = {
static FontOptionsList *fontOptionsList = IM_fontOptionsList;
static int fontCount = MSGDLGFONTCOUNT;
-struct branch_t {
+struct branch_t
+{
TCHAR* szDescr;
char* szDBName;
int iMode;
@@ -483,7 +484,8 @@ static TCHAR* chatcolorsnames[] =
LPGENT("Incremental search highlight")
};
-void RegisterFontServiceFonts() {
+void RegisterFontServiceFonts()
+{
char szTemp[100];
LOGFONT lf;
FontIDT fid = { 0 };
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 57928f9c74..70270c2132 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -622,18 +622,22 @@ void Chat_SetFilters(SESSION_INFO *si)
DWORD dwMask = db_get_dw(si->hContact, CHAT_MODULE, "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
- for (int i = 0; i < 32; i++)
- if (dwMask & (1 << i))
- si->iLogFilterFlags = (dwFlags_local & (1 << i) ? si->iLogFilterFlags | (1 << i) : si->iLogFilterFlags & ~(1 << i));
+ for (int i = 0; i < 32; i++) {
+ DWORD dwBit = 1 << i;
+ if (dwMask & dwBit)
+ si->iLogFilterFlags = (dwFlags_local & dwBit) ? si->iLogFilterFlags | dwBit : si->iLogFilterFlags & ~dwBit;
+ }
dwFlags_default = M.GetDword(CHAT_MODULE, "PopupFlags", 0x03E0);
dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "PopupFlags", 0x03E0);
dwMask = db_get_dw(si->hContact, CHAT_MODULE, "PopupMask", 0);
si->iLogPopupFlags = dwFlags_default;
- for (int i = 0; i < 32; i++)
- if (dwMask & (1 << i))
- si->iLogPopupFlags = (dwFlags_local & (1 << i) ? si->iLogPopupFlags | (1 << i) : si->iLogPopupFlags & ~(1 << i));
+ for (int i = 0; i < 32; i++) {
+ DWORD dwBit = 1 << i;
+ if (dwMask & dwBit)
+ si->iLogPopupFlags = (dwFlags_local & dwBit) ? si->iLogPopupFlags | dwBit : si->iLogPopupFlags & ~dwBit;
+ }
dwFlags_default = M.GetDword(CHAT_MODULE, "TrayIconFlags", 0x03E0);
dwFlags_local = db_get_dw(si->hContact, CHAT_MODULE, "TrayIconFlags", 0x03E0);
@@ -642,9 +646,11 @@ void Chat_SetFilters(SESSION_INFO *si)
si->iDiskLogFlags = M.GetDword(CHAT_MODULE, "DiskLogFlags", 0xFFFF);
si->iLogTrayFlags = dwFlags_default;
- for (int i = 0; i < 32; i++)
- if (dwMask & (1 << i))
- si->iLogTrayFlags = (dwFlags_local & (1 << i) ? si->iLogTrayFlags | (1 << i) : si->iLogTrayFlags & ~(1 << i));
+ for (int i = 0; i < 32; i++) {
+ DWORD dwBit = 1 << i;
+ if (dwMask & dwBit)
+ si->iLogTrayFlags = (dwFlags_local & dwBit) ? si->iLogTrayFlags | dwBit : si->iLogTrayFlags & ~dwBit;
+ }
if (si->iLogFilterFlags == 0)
si->bFilterEnabled = 0;