summaryrefslogtreecommitdiff
path: root/plugins/StopSpamMod/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-08-21 18:56:18 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-08-21 18:56:18 +0300
commit8e83809c7e6850cb3adef7c461093125189b4842 (patch)
treeb0673deda02c13373c2826c5c9a82cd3524bb66a /plugins/StopSpamMod/src
parent56fd5bdf2a55bd26ab7a6871a930915612c3d145 (diff)
fixes #4581 (StopSpamMod: remove ICQ/MRA support)
Diffstat (limited to 'plugins/StopSpamMod/src')
-rw-r--r--plugins/StopSpamMod/src/init.cpp8
-rw-r--r--plugins/StopSpamMod/src/options.cpp26
-rw-r--r--plugins/StopSpamMod/src/resource.h4
-rw-r--r--plugins/StopSpamMod/src/stopspam.cpp25
-rw-r--r--plugins/StopSpamMod/src/stopspam.h4
5 files changed, 4 insertions, 63 deletions
diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp
index 91e926469d..042ab9df58 100644
--- a/plugins/StopSpamMod/src/init.cpp
+++ b/plugins/StopSpamMod/src/init.cpp
@@ -39,15 +39,11 @@ BOOL gbRegexMatch = 0;
BOOL gbInvisDisable = 0;
BOOL gbIgnoreURL = 1;
BOOL gbLogToFile = 0;
-BOOL gbAutoAuth = 0;
-BOOL gbAutoAddToServerList = 0;
-BOOL gbAutoReqAuth = 1;
BOOL gbMathExpression = 0;
HANDLE hStopSpamLogDirH = nullptr;
wstring gbSpammersGroup = L"Spammers";
-wstring gbAutoAuthGroup = L"NotSpammers";
wstring gbQuestion;
wstring gbAnswer;
@@ -101,10 +97,6 @@ void InitVars()
gbRegexMatch = g_plugin.getByte("RegexMatch", 0);
gbInvisDisable = g_plugin.getByte("DisableInInvis", 0);
gbIgnoreURL = g_plugin.getByte("IgnoreURL", 0);
- gbAutoAuthGroup = DBGetContactSettingStringPAN(0, MODULENAME, "AutoAuthGroup", L"Not Spammers");
- gbAutoAuth = g_plugin.getByte("AutoAuth", 0);
- gbAutoAddToServerList = g_plugin.getByte("AutoAddToServerList", 0);
- gbAutoReqAuth = g_plugin.getByte("AutoReqAuth", 0);
gbLogToFile = g_plugin.getByte("LogSpamToFile", 0);
gbHistoryLog = g_plugin.getByte("HistoryLog", 0);
gbMathExpression = g_plugin.getByte("MathExpression", 0);
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp
index 1958598f63..1d9003a2f6 100644
--- a/plugins/StopSpamMod/src/options.cpp
+++ b/plugins/StopSpamMod/src/options.cpp
@@ -196,9 +196,9 @@ public:
class COptAdvancedDlg : public CDlgBase
{
- CCtrlEdit edit_SPECIALGROUPNAME, edit_AUTOADDGROUP;
+ CCtrlEdit edit_SPECIALGROUPNAME;
CCtrlCheck chk_INVIS_DISABLE, chk_CASE_INSENSITIVE, chk_SPECIALGROUP, chk_EXCLUDE, chk_REMOVE_TMP;
- CCtrlCheck chk_IGNOREURL, chk_AUTOAUTH, chk_ADDTOSRVLST, chk_REQAUTH, chk_REGEX, chk_HISTORY_LOG, chk_MATH_QUESTION;
+ CCtrlCheck chk_IGNOREURL, chk_REGEX, chk_HISTORY_LOG, chk_MATH_QUESTION;
CCtrlButton btn_MATH_DETAILS;
public:
@@ -209,14 +209,10 @@ public:
chk_EXCLUDE(this, ID_EXCLUDE),
chk_REMOVE_TMP(this, ID_REMOVE_TMP),
chk_IGNOREURL(this, ID_IGNOREURL),
- chk_AUTOAUTH(this, IDC_AUTOAUTH),
- chk_ADDTOSRVLST(this, IDC_ADDTOSRVLST),
- chk_REQAUTH(this, IDC_REQAUTH),
chk_REGEX(this, IDC_REGEX),
chk_HISTORY_LOG(this, IDC_HISTORY_LOG),
chk_MATH_QUESTION(this, IDC_MATH_QUESTION),
edit_SPECIALGROUPNAME(this, ID_SPECIALGROUPNAME),
- edit_AUTOADDGROUP(this, IDC_AUTOADDGROUP),
btn_MATH_DETAILS(this, IDC_MATH_DETAILS)
{
btn_MATH_DETAILS.OnClick = Callback(this, &COptAdvancedDlg::onClick_MATH_DETAILS);
@@ -230,13 +226,9 @@ public:
chk_EXCLUDE.SetState(gbExclude);
chk_REMOVE_TMP.SetState(gbDelExcluded);
chk_IGNOREURL.SetState(gbIgnoreURL);
- chk_AUTOAUTH.SetState(gbAutoAuth);
- chk_ADDTOSRVLST.SetState(gbAutoAddToServerList);
- chk_REQAUTH.SetState(gbAutoReqAuth);
chk_REGEX.SetState(gbRegexMatch);
chk_HISTORY_LOG.SetState(gbHistoryLog);
chk_MATH_QUESTION.SetState(gbMathExpression);
- edit_AUTOADDGROUP.SetText(gbAutoAuthGroup.c_str());
return true;
}
@@ -260,23 +252,9 @@ public:
g_plugin.setByte("DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState());
g_plugin.setByte("IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState());
- g_plugin.setByte("AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState());
- g_plugin.setByte("AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState());
- g_plugin.setByte("AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState());
g_plugin.setByte("RegexMatch", gbRegexMatch = chk_REGEX.GetState());
g_plugin.setByte("HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState());
g_plugin.setByte("MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState());
- {
- static wstring NewAGroupName = edit_AUTOADDGROUP.GetText(), CurrentAGroupName;
- CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(0, MODULENAME, "AutoAuthGroup", L"0");
- if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) {
- bool GroupExist = Clist_GroupExists(NewAGroupName.c_str()) != NULL;
- g_plugin.setWString("AutoAuthGroup", NewAGroupName.c_str());
- gbAutoAuthGroup = DBGetContactSettingStringPAN(0, MODULENAME, "AutoAuthGroup", L"Not Spammers");
- if (!GroupExist && gbAutoAddToServerList)
- Clist_GroupCreate(0, gbAutoAuthGroup.c_str());
- }
- }
return true;
}
diff --git a/plugins/StopSpamMod/src/resource.h b/plugins/StopSpamMod/src/resource.h
index 1b375d16eb..7a23ae5bf6 100644
--- a/plugins/StopSpamMod/src/resource.h
+++ b/plugins/StopSpamMod/src/resource.h
@@ -39,12 +39,8 @@
#define ID_EXCLUDE 1021
#define ID_ADDPERMANENT3 1022
#define ID_DEL_NO_IN_LIST 1022
-#define IDC_ADDTOSRVLST 1022
#define ID_IGNOREURL 1023
#define IDC_EDIT1 1024
-#define IDC_AUTOADDGROUP 1024
-#define IDC_AUTOAUTH 1025
-#define IDC_REQAUTH 1026
#define IDC_LOGSPAMTOFILE 1027
#define ID_LOGSPAMTOFILE 1027
#define IDC_REGEX 1028
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp
index 8ac386e370..bb8ed11219 100644
--- a/plugins/StopSpamMod/src/stopspam.cpp
+++ b/plugins/StopSpamMod/src/stopspam.cpp
@@ -157,30 +157,9 @@ int OnDbEventFilterAdd(WPARAM hContact, LPARAM l)
Contact::PutOnList(hContact);
// send congratulation
- if (bSendMsg) {
- wstring prot = DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L"");
- // for notICQ protocols or disable auto auth. request
- if ((Stricmp(L"ICQ", prot.c_str())) || (!gbAutoReqAuth)) {
- char *buf = mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str());
- ProtoChainSend(hContact, PSS_MESSAGE, 0, (LPARAM)buf);
- mir_free(buf);
- }
- // Note: For ANSI can be not work
- if (!Stricmp(L"ICQ", prot.c_str())) {
- // grand auth.
- if (gbAutoAuth)
- CallProtoService(dbei->szModule, "/GrantAuth", hContact, 0);
- // add contact to server list and local group
- if (gbAutoAddToServerList) {
- Clist_SetGroup(hContact, gbAutoAuthGroup.c_str());
- Contact::PutOnList(hContact);
- }
+ if (bSendMsg)
+ DBGetContactSettingStringPAN(NULL, dbei->szModule, "AM_BaseProto", L"");
- // auto auth. request with send congratulation
- if (gbAutoReqAuth)
- ProtoChainSend(hContact, PSS_AUTHREQUEST, 0, (LPARAM)variables_parse(gbCongratulation, hContact).c_str());
- }
- }
return 0;
}
// URL contains check
diff --git a/plugins/StopSpamMod/src/stopspam.h b/plugins/StopSpamMod/src/stopspam.h
index 7861eeda13..47d5f13a67 100644
--- a/plugins/StopSpamMod/src/stopspam.h
+++ b/plugins/StopSpamMod/src/stopspam.h
@@ -23,8 +23,4 @@ extern wstring gbQuestion;
extern wstring gbAnswer;
extern wstring gbCongratulation;
extern std::wstring gbAuthRepl;
-extern BOOL gbAutoAuth;
-extern BOOL gbAutoAddToServerList;
-extern BOOL gbAutoReqAuth;
-extern wstring gbAutoAuthGroup;
extern BOOL gbLogToFile;