summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-10-22 21:12:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-10-22 21:12:41 +0000
commit169df25f12faff23b8fd8c20e057af715a2777ca (patch)
treeedf370921349caead3ade24dbb6e2107a8d3e894 /src/mir_app
parent41054e98a022a7a7f869683472e85ace6ab5a837 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@15599 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/ignore.cpp171
1 files changed, 90 insertions, 81 deletions
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp
index 00d0384d74..94536bbfac 100644
--- a/src/mir_app/src/ignore.cpp
+++ b/src/mir_app/src/ignore.cpp
@@ -26,13 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IGNOREEVENT_MAX 7
-static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = {PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
-static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX] = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING};
+static const DWORD ignoreIdToPf1[IGNOREEVENT_MAX] = { PF1_IMRECV, PF1_URLRECV, PF1_FILERECV, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
+static const DWORD ignoreIdToPf4[IGNOREEVENT_MAX] = { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, PF4_SUPPORTTYPING };
static DWORD GetMask(MCONTACT hContact)
{
- DWORD mask = db_get_dw(hContact, "Ignore", "Mask1", (DWORD)(-1));
- if (mask == (DWORD)(-1)) {
+ DWORD mask = db_get_dw(hContact, "Ignore", "Mask1", (DWORD)-1);
+ if (mask == (DWORD)-1) {
if (hContact == NULL) mask = 0;
else {
if (db_get_b(hContact, "CList", "Hidden", 0) || db_get_b(hContact, "CList", "NotOnList", 0))
@@ -46,9 +46,8 @@ static DWORD GetMask(MCONTACT hContact)
static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount)
{
- int iconOn[IGNOREEVENT_MAX] = {1, 1, 1, 1, 1, 1, 1};
- int childCount[IGNOREEVENT_MAX] = {0, 0, 0, 0, 0, 0, 0}, i;
- int iImage;
+ int iconOn[IGNOREEVENT_MAX] = { 1, 1, 1, 1, 1, 1, 1 };
+ int childCount[IGNOREEVENT_MAX] = { 0, 0, 0, 0, 0, 0, 0 }, i;
HANDLE hItem, hChildItem;
int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
@@ -58,7 +57,7 @@ static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt
while (hItem) {
hChildItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hChildItem) SetListGroupIcons(hwndList, hChildItem, hItem, childCount);
- for (i=0; i < _countof(iconOn); i++)
+ for (i = 0; i < _countof(iconOn); i++)
if (iconOn[i] && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == 0) iconOn[i] = 0;
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
@@ -66,8 +65,8 @@ static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt
if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
- for (i=0; i < _countof(iconOn); i++) {
- iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
+ for (i = 0; i < _countof(iconOn); i++) {
+ int iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i);
if (iconOn[i] && iImage == 0) iconOn[i] = 0;
if (iImage != EMPTY_EXTRA_ICON)
childCount[i]++;
@@ -75,12 +74,13 @@ static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentIt
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
//set icons
- for (i=0; i < _countof(iconOn); i++) {
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i]?(iconOn[i]?i+3:0) : EMPTY_EXTRA_ICON));
- if (groupChildCount) groupChildCount[i]+=childCount[i];
+ for (i = 0; i < _countof(iconOn); i++) {
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(i, childCount[i] ? (iconOn[i] ? i + 3 : 0) : EMPTY_EXTRA_ICON));
+ if (groupChildCount)
+ groupChildCount[i] += childCount[i];
}
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hParentItem, MAKELPARAM(IGNOREEVENT_MAX + 1, 2));
}
static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
@@ -88,7 +88,8 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int
HANDLE hItem;
int typeOfFirst = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hFirstItem, 0);
- //check groups
+
+ // check groups
if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
while (hItem) {
@@ -97,7 +98,8 @@ static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int
SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
- //check contacts
+
+ // check contacts
if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
while (hItem) {
@@ -115,14 +117,7 @@ static void ResetListOptions(HWND hwndList)
static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int iColumn, int iImage)
{
- switch ( SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0)) {
- case CLCIT_CONTACT:
- {
- int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
- if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
- }
- break;
+ switch (SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0)) {
case CLCIT_INFO:
if (hItem == hItemAll)
SetAllChildIcons(hwndList, hItem, iColumn, iImage);
@@ -134,29 +129,45 @@ static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int
hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItem)
SetAllChildIcons(hwndList, hItem, iColumn, iImage);
+ break;
+
+ case CLCIT_CONTACT:
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ break;
}
}
static void InitialiseItem(HWND hwndList, MCONTACT hContact, HANDLE hItem, DWORD proto1Caps, DWORD proto4Caps)
{
DWORD mask = GetMask(hContact);
- for (int i=0; i < IGNOREEVENT_MAX; i++)
+ for (int i = 0; i < IGNOREEVENT_MAX; i++)
if ((ignoreIdToPf1[i] == 0xFFFFFFFF && ignoreIdToPf4[i] == 0xFFFFFFFF) || (proto1Caps&ignoreIdToPf1[i] || proto4Caps&ignoreIdToPf4[i]))
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, mask&(1<<i)?i+3:0));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, mask&(1 << i) ? i + 3 : 0));
SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 1));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX+1, 2));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX + 1, 2));
+}
+
+static void SaveItemValue(MCONTACT hContact, const char *pszSetting, DWORD dwValue)
+{
+ db_set_dw(hContact, "Ignore", pszSetting, dwValue);
+
+ // assign the same value to all subs, if any
+ for (int i = db_mc_getSubCount(hContact)-1; i >= 0; i--)
+ db_set_dw(db_mc_getSub(hContact, i), "Ignore", pszSetting, dwValue);
}
static void SaveItemMask(HWND hwndList, MCONTACT hContact, HANDLE hItem, const char *pszSetting)
{
DWORD mask = 0;
- for (int i=0; i < IGNOREEVENT_MAX; i++) {
+ for (int i = 0; i < IGNOREEVENT_MAX; i++) {
int iImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(i, 0));
if (iImage && iImage != EMPTY_EXTRA_ICON)
mask |= 1 << i;
}
- db_set_dw(hContact, "Ignore", pszSetting, mask);
+ SaveItemValue(hContact, pszSetting, mask);
}
static void SetAllContactIcons(HWND hwndList)
@@ -167,8 +178,8 @@ static void SetAllContactIcons(HWND hwndList)
DWORD proto1Caps, proto4Caps;
char *szProto = GetContactProto(hContact);
if (szProto) {
- proto1Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- proto4Caps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_4, 0);
+ proto1Caps = CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_1, 0);
+ proto4Caps = CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAGNUM_4, 0);
}
else proto1Caps = proto4Caps = 0;
InitialiseItem(hwndList, hContact, hItem, proto1Caps, proto4Caps);
@@ -180,7 +191,7 @@ static void SetAllContactIcons(HWND hwndList)
static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
- static HICON hIcons[IGNOREEVENT_MAX+2];
+ static HICON hIcons[IGNOREEVENT_MAX + 2];
static HANDLE hItemAll, hItemUnknown;
switch (msg) {
@@ -200,8 +211,8 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_TYPING);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
- for (int i=0; i < _countof(hIcons); i++)
- hIcons[i] = ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
+ for (int i = 0; i < _countof(hIcons); i++)
+ hIcons[i] = ImageList_GetIcon(hIml, 1 + i, ILD_NORMAL);
}
SendDlgItemMessage(hwndDlg, IDC_ALLICON, STM_SETICON, (WPARAM)hIcons[0], 0);
@@ -215,7 +226,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
SendDlgItemMessage(hwndDlg, IDC_TYPINGICON, STM_SETICON, (WPARAM)hIcons[8], 0);
ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
- SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, IGNOREEVENT_MAX+2, 0);
+ SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRACOLUMNS, IGNOREEVENT_MAX + 2, 0);
{
CLCINFOITEM cii = { sizeof(cii) };
cii.flags = CLCIIF_GROUPFONT;
@@ -224,27 +235,27 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
cii.pszText = TranslateT("** Unknown contacts **");
hItemUnknown = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- InitialiseItem( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, 0xFFFFFFFF, 0xFFFFFFFF);
+ InitialiseItem(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, 0xFFFFFFFF, 0xFFFFFFFF);
}
- SetAllContactIcons( GetDlgItem(hwndDlg, IDC_LIST));
- SetListGroupIcons( GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
return TRUE;
case WM_SETFOCUS:
- SetFocus( GetDlgItem(hwndDlg, IDC_LIST));
+ SetFocus(GetDlgItem(hwndDlg, IDC_LIST));
break;
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_LIST:
switch (((LPNMHDR)lParam)->code) {
case CLN_NEWCONTACT:
case CLN_LISTREBUILT:
- SetAllContactIcons( GetDlgItem(hwndDlg, IDC_LIST));
+ SetAllContactIcons(GetDlgItem(hwndDlg, IDC_LIST));
//fall through
case CLN_CONTACTMOVED:
- SetListGroupIcons( GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
break;
case CLN_OPTIONSCHANGED:
ResetListOptions(GetDlgItem(hwndDlg, IDC_LIST));
@@ -253,35 +264,33 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case NM_CLICK:
- {
- NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
- if (nm->iColumn == -1)
- break;
-
- DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
- if (hItem == NULL || !(hitFlags & CLCHT_ONITEMEXTRA))
- break;
-
- if (nm->iColumn == IGNOREEVENT_MAX) { // ignore all
- for (int iImage = 0;iImage<IGNOREEVENT_MAX;iImage++)
- SetIconsForColumn( GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, iImage+3);
- }
- else if (nm->iColumn == IGNOREEVENT_MAX+1) { // ignore none
- for (int iImage = 0;iImage<IGNOREEVENT_MAX;iImage++)
- SetIconsForColumn( GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, 0);
- }
- else {
- int iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
- if (iImage == 0)
- iImage = nm->iColumn+3;
- else if (iImage != EMPTY_EXTRA_ICON)
- iImage = 0;
- SetIconsForColumn( GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, nm->iColumn, iImage);
- }
- SetListGroupIcons( GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
+ if (nm->iColumn == -1)
+ break;
+
+ DWORD hitFlags;
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+ if (hItem == NULL || !(hitFlags & CLCHT_ONITEMEXTRA))
+ break;
+
+ if (nm->iColumn == IGNOREEVENT_MAX) { // ignore all
+ for (int iImage = 0; iImage < IGNOREEVENT_MAX; iImage++)
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, iImage + 3);
}
+ else if (nm->iColumn == IGNOREEVENT_MAX + 1) { // ignore none
+ for (int iImage = 0; iImage < IGNOREEVENT_MAX; iImage++)
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, iImage, 0);
+ }
+ else {
+ int iImage = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
+ if (iImage == 0)
+ iImage = nm->iColumn + 3;
+ else if (iImage != EMPTY_EXTRA_ICON)
+ iImage = 0;
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_LIST), hItem, hItemAll, nm->iColumn, iImage);
+ }
+ SetListGroupIcons(GetDlgItem(hwndDlg, IDC_LIST), (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETNEXTITEM, CLGN_ROOT, 0), hItemAll, NULL);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
@@ -290,22 +299,22 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case PSN_APPLY:
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, hContact, 0);
- if (hItem) SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
+ if (hItem) SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
if (SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
db_unset(hContact, "CList", "Hidden");
else
db_set_b(hContact, "CList", "Hidden", 1);
}
- SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
- SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
+ SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
+ SaveItemMask(GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
return TRUE;
}
}
break;
case WM_DESTROY:
- for (int i=0; i < _countof(hIcons); i++)
+ for (int i = 0; i < _countof(hIcons); i++)
DestroyIcon(hIcons[i]);
HIMAGELIST hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
@@ -333,7 +342,7 @@ static INT_PTR IsIgnored(WPARAM wParam, LPARAM lParam)
DWORD mask = GetMask(wParam);
if (lParam < 1 || lParam > IGNOREEVENT_MAX)
return 1;
- return (mask >> (lParam-1))&1;
+ return (mask >> (lParam - 1)) & 1;
}
static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
@@ -342,10 +351,10 @@ static INT_PTR Ignore(WPARAM wParam, LPARAM lParam)
if ((lParam < 1 || lParam > IGNOREEVENT_MAX) && lParam != IGNOREEVENT_ALL)
return 1;
if (lParam == IGNOREEVENT_ALL)
- mask = (1 << IGNOREEVENT_MAX)-1;
+ mask = (1 << IGNOREEVENT_MAX) - 1;
else
- mask |= 1 << (lParam-1);
- db_set_dw(wParam, "Ignore", "Mask1", mask);
+ mask |= 1 << (lParam - 1);
+ SaveItemValue(wParam, "Mask1", mask);
return 0;
}
@@ -358,8 +367,8 @@ static INT_PTR Unignore(WPARAM wParam, LPARAM lParam)
if (lParam == IGNOREEVENT_ALL)
mask = 0;
else
- mask &= ~(1 << (lParam-1));
- db_set_dw(wParam, "Ignore", "Mask1", mask);
+ mask &= ~(1 << (lParam - 1));
+ SaveItemValue(wParam, "Mask1", mask);
return 0;
}
@@ -434,7 +443,7 @@ int LoadIgnoreModule(void)
CreateProtoServiceFunction("Ignore", PSR_URL, IgnoreRecvUrl);
CreateProtoServiceFunction("Ignore", PSR_FILE, IgnoreRecvFile);
CreateProtoServiceFunction("Ignore", PSR_AUTH, IgnoreRecvAuth);
-
+
CreateServiceFunction(MS_IGNORE_ISIGNORED, IsIgnored);
CreateServiceFunction(MS_IGNORE_IGNORE, Ignore);
CreateServiceFunction(MS_IGNORE_UNIGNORE, Unignore);