diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-11-23 21:16:29 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-11-23 21:16:29 +0000 |
commit | 0e0f39de21f7f8a45d50de3903efbfadca1d6bb0 (patch) | |
tree | cbee8ad63bc0b0fab279482e34f1f90e4273f240 /plugins/StopSpamMod | |
parent | a7ca60f2c217eb28aeb0caac5a9240600ffc57e8 (diff) |
- Atavism in StopSpamMod removed (fixes #1097)
git-svn-id: http://svn.miranda-ng.org/main/trunk@15764 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StopSpamMod')
-rwxr-xr-x | plugins/StopSpamMod/res/stopspam.rc | 2 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/eventhooker.cpp | 132 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/init.cpp | 2 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/options.cpp | 4 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/resource.h | 1 | ||||
-rwxr-xr-x | plugins/StopSpamMod/src/stopspam.h | 1 |
6 files changed, 66 insertions, 76 deletions
diff --git a/plugins/StopSpamMod/res/stopspam.rc b/plugins/StopSpamMod/res/stopspam.rc index dcfcb588f6..a812942e05 100755 --- a/plugins/StopSpamMod/res/stopspam.rc +++ b/plugins/StopSpamMod/res/stopspam.rc @@ -81,8 +81,6 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,66,279,10
CONTROL "Disable question in invisible mode",IDC_INVIS_DISABLE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,77,287,10
- CONTROL "Enable integration with DOS plugin",ID_DOS_INTEGRATION,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,89,287,8
CONTROL "Exclude contacts which we sending something from spam check",ID_EXCLUDE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,33,287,8
CONTROL "Remove Excluded contacts after restart",ID_REMOVE_TMP,
diff --git a/plugins/StopSpamMod/src/eventhooker.cpp b/plugins/StopSpamMod/src/eventhooker.cpp index e93e4169be..d9b9296bfe 100755 --- a/plugins/StopSpamMod/src/eventhooker.cpp +++ b/plugins/StopSpamMod/src/eventhooker.cpp @@ -1,67 +1,67 @@ -/* eventhooker.cpp -* Copyright (C) Miklashevsky Roman, sss, elzor -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* as published by the Free Software Foundation; either version 2 -* of the License, or (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - +/* eventhooker.cpp
+* Copyright (C) Miklashevsky Roman, sss, elzor
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
#include "stdafx.h"
- -namespace miranda -{ - namespace - { - std::list<EventHooker*> eventHookerList; - } - - EventHooker::EventHooker(std::string name, MIRANDAHOOK fun) : name_(name), fun_(fun), handle_(0) - { - eventHookerList.push_back(this); - } - - EventHooker::~EventHooker() - { - eventHookerList.remove(this); - } - - void EventHooker::Hook() - { - handle_ = HookEvent(name_.c_str(), fun_); - } - - void EventHooker::Unhook() - { - if(handle_) - { - UnhookEvent(handle_); - handle_ = 0; - } - } - - void EventHooker::HookAll() - { - for(std::list<EventHooker*>::iterator it = eventHookerList.begin(); it != eventHookerList.end(); ++it) - { - (*it)->Hook(); - } - } - - void EventHooker::UnhookAll() - { - for(std::list<EventHooker*>::iterator it = eventHookerList.begin(); it != eventHookerList.end(); ++it) - { - (*it)->Unhook(); - } - } -} +
+namespace miranda
+{
+ namespace
+ {
+ std::list<EventHooker*> eventHookerList;
+ }
+
+ EventHooker::EventHooker(std::string name, MIRANDAHOOK fun) : name_(name), fun_(fun), handle_(0)
+ {
+ eventHookerList.push_back(this);
+ }
+
+ EventHooker::~EventHooker()
+ {
+ eventHookerList.remove(this);
+ }
+
+ void EventHooker::Hook()
+ {
+ handle_ = HookEvent(name_.c_str(), fun_);
+ }
+
+ void EventHooker::Unhook()
+ {
+ if(handle_)
+ {
+ UnhookEvent(handle_);
+ handle_ = 0;
+ }
+ }
+
+ void EventHooker::HookAll()
+ {
+ for(std::list<EventHooker*>::iterator it = eventHookerList.begin(); it != eventHookerList.end(); ++it)
+ {
+ (*it)->Hook();
+ }
+ }
+
+ void EventHooker::UnhookAll()
+ {
+ for(std::list<EventHooker*>::iterator it = eventHookerList.begin(); it != eventHookerList.end(); ++it)
+ {
+ (*it)->Unhook();
+ }
+ }
+}
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index d34d08d03a..44f1bea69a 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -31,7 +31,6 @@ BOOL gbExclude = 1; BOOL gbDelExcluded = 0;
BOOL gbDelAllTempory = 0;
BOOL gbHistoryLog = 0;
-BOOL gbDosServiceIntegration = 0;
BOOL gbCaseInsensitive = 0;
BOOL gbRegexMatch = 0;
BOOL gbInvisDisable = 0;
@@ -80,7 +79,6 @@ extern tstring DBGetContactSettingStringPAN(MCONTACT hContact, char const * szMo void InitVars()
{
- gbDosServiceIntegration = db_get_b(NULL, pluginName, "DOSIntegration", 0);
gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", _T("Spammers"));
gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", _T("nospam"));
gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", _T("Congratulations! You just passed human/robot test. Now you can write me a message."));
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index 8b1698f996..c4c32f55dc 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -224,8 +224,6 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TranslateDialogDefault(hwnd);
CheckDlgButton(hwnd, IDC_INVIS_DISABLE, gbInvisDisable ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CASE_INSENSITIVE, gbCaseInsensitive ? BST_CHECKED : BST_UNCHECKED);
- gbDosServiceExist ? EnableWindow(GetDlgItem(hwnd, ID_DOS_INTEGRATION), 1) : EnableWindow(GetDlgItem(hwnd, ID_DOS_INTEGRATION), 0);
- CheckDlgButton(hwnd, ID_DOS_INTEGRATION, gbDosServiceIntegration ? BST_CHECKED : BST_UNCHECKED);
SetDlgItemText(hwnd, ID_SPECIALGROUPNAME, gbSpammersGroup.c_str());
CheckDlgButton(hwnd, ID_SPECIALGROUP, gbSpecialGroup ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, ID_EXCLUDE, gbExclude ? BST_CHECKED : BST_UNCHECKED);
@@ -250,7 +248,6 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case IDC_INVIS_DISABLE:
case IDC_CASE_INSENSITIVE:
- case ID_DOS_INTEGRATION:
case ID_SPECIALGROUPNAME:
case ID_SPECIALGROUP:
case ID_EXCLUDE:
@@ -274,7 +271,6 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case PSN_APPLY:
db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_CASE_INSENSITIVE));
db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = BST_CHECKED == IsDlgButtonChecked(hwnd, IDC_INVIS_DISABLE));
- db_set_b(NULL, pluginName, "DOSIntegration", gbDosServiceIntegration = BST_CHECKED == IsDlgButtonChecked(hwnd, ID_DOS_INTEGRATION));
{
static tstring NewGroupName, CurrentGroupName;
NewGroupName = GetDlgItemString(hwnd, ID_SPECIALGROUPNAME);
diff --git a/plugins/StopSpamMod/src/resource.h b/plugins/StopSpamMod/src/resource.h index 05f1ba3267..cf08fba600 100755 --- a/plugins/StopSpamMod/src/resource.h +++ b/plugins/StopSpamMod/src/resource.h @@ -25,7 +25,6 @@ #define ID_ADDPERMANENT 1014
#define ID_ADDPERMANENT2 1015
#define ID_HANDLEAUTHREQ 1015
-#define ID_DOS_INTEGRATION 1016
#define ID_SPECIALGROUP 1017
#define IDC_BUTTON1 1017
#define IDC_VARS 1017
diff --git a/plugins/StopSpamMod/src/stopspam.h b/plugins/StopSpamMod/src/stopspam.h index 94300b9713..b783dc4d40 100755 --- a/plugins/StopSpamMod/src/stopspam.h +++ b/plugins/StopSpamMod/src/stopspam.h @@ -10,7 +10,6 @@ extern BOOL gbHideContacts; extern BOOL gbIgnoreContacts; extern BOOL gbExclude; extern BOOL gbDelExcluded; -extern BOOL gbDosServiceIntegration; extern BOOL gbDelNotInList; extern BOOL gbCaseInsensitive; extern BOOL gbRegexMatch; |