From 81530fe1f1af7e07ed17486ab6c6b1ef433e7f51 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@63852ff1-2cfd-40b9-8011-e561a9d89b1c> Date: Wed, 3 Dec 2008 12:48:27 +0000 Subject: option for delete contacts in "Not In List" group git-svn-id: http://172.18.13.13/svn/mim_plugs@5 63852ff1-2cfd-40b9-8011-e561a9d89b1c --- stopspam_mod/trunk/init.cpp | 2 ++ stopspam_mod/trunk/options.cpp | 3 +++ stopspam_mod/trunk/resource.h | 2 ++ stopspam_mod/trunk/stopspam.cpp | 3 +++ stopspam_mod/trunk/stopspam.h | 1 + stopspam_mod/trunk/stopspam.rc | 12 +++++++----- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/stopspam_mod/trunk/init.cpp b/stopspam_mod/trunk/init.cpp index c6ca83d..62ab8b0 100644 --- a/stopspam_mod/trunk/init.cpp +++ b/stopspam_mod/trunk/init.cpp @@ -14,6 +14,7 @@ BOOL gbIgnoreContacts = 0; BOOL gbExclude = 1; BOOL gbDelExcluded = 0; BOOL gbDosServiceIntegration = 0; +BOOL gbDelNotInList = 0; tstring gbSpammersGroup = _T("Spammers"); tstring gbQuestion; tstring gbAnswer; @@ -76,6 +77,7 @@ void InitVars() gbIgnoreContacts = DBGetContactSettingByte(NULL, pluginName, "IgnoreContacts", 0); gbExclude = DBGetContactSettingByte(NULL, pluginName, "ExcludeContacts", 1); gbDelExcluded = DBGetContactSettingByte(NULL, pluginName, "DelExcluded", 0); + gbDelNotInList = DBGetContactSettingByte(NULL, pluginName, "DelNotInList", 0); } static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) diff --git a/stopspam_mod/trunk/options.cpp b/stopspam_mod/trunk/options.cpp index 79389a8..8e78301 100644 --- a/stopspam_mod/trunk/options.cpp +++ b/stopspam_mod/trunk/options.cpp @@ -34,6 +34,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hwnd, ID_IGNORESPAMMERS, BM_SETCHECK, gbIgnoreContacts ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessage(hwnd, ID_EXCLUDE, BM_SETCHECK, gbExclude ? BST_CHECKED : BST_UNCHECKED, 0); SendDlgItemMessage(hwnd, ID_REMOVE_TMP, BM_SETCHECK, gbDelExcluded ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(hwnd, ID_DEL_NO_IN_LIST, BM_SETCHECK, gbDelNotInList ? BST_CHECKED : BST_UNCHECKED, 0); } return TRUE; case WM_COMMAND:{ @@ -66,6 +67,8 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) BST_CHECKED == SendDlgItemMessage(hwnd, ID_HANDLEAUTHREQ, BM_GETCHECK, 0, 0)); DBWriteContactSettingByte(NULL, pluginName, "DOSIntegration", gbDosServiceIntegration = BST_CHECKED == SendDlgItemMessage(hwnd, ID_DOS_INTEGRATION, BM_GETCHECK, 0, 0)); + DBWriteContactSettingByte(NULL, pluginName, "DelNotInList", gbDelNotInList = + BST_CHECKED == SendDlgItemMessage(hwnd, ID_DEL_NO_IN_LIST, BM_GETCHECK, 0, 0)); { static tstring NewGroupName, CurrentGroupName; NewGroupName = GetDlgItemString(hwnd, ID_SPECIALGROUPNAME); diff --git a/stopspam_mod/trunk/resource.h b/stopspam_mod/trunk/resource.h index 1802b8d..4e5950e 100644 --- a/stopspam_mod/trunk/resource.h +++ b/stopspam_mod/trunk/resource.h @@ -31,6 +31,8 @@ #define ID_REMOVE_TMP 1020 #define ID_REMOVE_TMP2 1021 #define ID_EXCLUDE 1021 +#define ID_ADDPERMANENT3 1022 +#define ID_DEL_NO_IN_LIST 1022 // Next default values for new objects // diff --git a/stopspam_mod/trunk/stopspam.cpp b/stopspam_mod/trunk/stopspam.cpp index 100fb28..dc68edb 100644 --- a/stopspam_mod/trunk/stopspam.cpp +++ b/stopspam_mod/trunk/stopspam.cpp @@ -4,6 +4,9 @@ extern TCHAR const * defQuestion; MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) { + if(gbDelNotInList) + if(DBGetContactSettingStringPAN_A((HANDLE)w, "CList", "Group", "") == "Not In List") + CallService(MS_DB_CONTACT_DELETE, (WPARAM)w, 0); DBWriteContactSettingByte((HANDLE)w, "CList", "NotOnList", 1); return 0; } diff --git a/stopspam_mod/trunk/stopspam.h b/stopspam_mod/trunk/stopspam.h index 48cc7c7..10088bb 100644 --- a/stopspam_mod/trunk/stopspam.h +++ b/stopspam_mod/trunk/stopspam.h @@ -10,6 +10,7 @@ extern BOOL gbIgnoreContacts; extern BOOL gbExclude; extern BOOL gbDelExcluded; extern BOOL gbDosServiceIntegration; +extern BOOL gbDelNotInList; extern tstring gbSpammersGroup; extern tstring gbQuestion; extern tstring gbAnswer; diff --git a/stopspam_mod/trunk/stopspam.rc b/stopspam_mod/trunk/stopspam.rc index e3acf25..e7b83fe 100644 --- a/stopspam_mod/trunk/stopspam.rc +++ b/stopspam_mod/trunk/stopspam.rc @@ -60,9 +60,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN EDITTEXT ID_DESCRIPTION,12,7,290,82,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_TABSTOP - CTEXT "Do not send more than ",IDC_STATIC,11,93,101,12,SS_CENTERIMAGE - EDITTEXT ID_MAXQUESTCOUNT,113,93,30,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT " questions to one contact (0 - for no limit)",IDC_STATIC,144,93,155,12,SS_CENTERIMAGE + LTEXT "Do not send more than ",IDC_STATIC,11,89,87,12,SS_CENTERIMAGE + EDITTEXT ID_MAXQUESTCOUNT,107,89,30,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT " questions to one contact (0 - for no limit)",IDC_STATIC,144,89,155,12,SS_CENTERIMAGE CONTROL "Enable StopSpam-StopSpam infinite talk protection",ID_INFTALKPROT, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,122,270,10 CONTROL "Add contact permanently",ID_ADDPERMANENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,134,270,8 @@ -70,8 +70,8 @@ BEGIN CONTROL "Enable integration with DOS plugin",ID_DOS_INTEGRATION, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,199,270,8 CONTROL "Add contacts to specified group:",ID_SPECIALGROUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,110,134,10 - EDITTEXT ID_SPECIALGROUPNAME,152,109,53,12,ES_AUTOHSCROLL + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,111,134,10 + EDITTEXT ID_SPECIALGROUPNAME,152,110,53,12,ES_AUTOHSCROLL CONTROL "Hide unanswered contacts and spammers from contact list",ID_HIDECONTACTS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,156,279,10 CONTROL "Ignore spammers (do not write messages to history)",ID_IGNORESPAMMERS, @@ -80,6 +80,8 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,188,270,8 CONTROL "Exclude contacts which we sending something from spam check",ID_EXCLUDE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,178,270,8 + CONTROL "Automatically delete contacts from ""Not In List"" group",ID_DEL_NO_IN_LIST, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,101,270,8 END -- cgit v1.2.3