diff options
author | George Hazan <george.hazan@gmail.com> | 2015-03-30 15:06:19 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-03-30 15:06:19 +0000 |
commit | 84a693e4ea7d3072b2188152736aca7c8b885863 (patch) | |
tree | 0ccea849066ca3cd2836811d419d519d5d1d9666 /plugins/TabSRMM/src/chat/tools.cpp | |
parent | 5af8f1dae14233cb203d78da7b5b1a286272cc6a (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/chat/tools.cpp')
-rw-r--r-- | plugins/TabSRMM/src/chat/tools.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
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;
|