summaryrefslogtreecommitdiff
path: root/plugins/StopSpamMod/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/StopSpamMod/src/options.cpp
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/StopSpamMod/src/options.cpp')
-rwxr-xr-xplugins/StopSpamMod/src/options.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp
index 1ed210bdc3..9847352c76 100755
--- a/plugins/StopSpamMod/src/options.cpp
+++ b/plugins/StopSpamMod/src/options.cpp
@@ -47,13 +47,13 @@ public:
}
virtual void OnApply() override
{
- db_set_dw(NULL, pluginName, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt());
- db_set_b(NULL, pluginName, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState());
- db_set_b(NULL, pluginName, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState());
- db_set_b(NULL, pluginName, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState());
- db_set_b(NULL, pluginName, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState());
- db_set_b(NULL, pluginName, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState());
- db_set_b(NULL, pluginName, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState());
+ db_set_dw(NULL, MODULENAME, "maxQuestCount", gbMaxQuestCount = edit_MAXQUESTCOUNT.GetInt());
+ db_set_b(NULL, MODULENAME, "infTalkProtection", gbInfTalkProtection = chk_INFTALKPROT.GetState());
+ db_set_b(NULL, MODULENAME, "addPermanent", gbAddPermanent = chk_ADDPERMANENT.GetState());
+ db_set_b(NULL, MODULENAME, "handleAuthReq", gbHandleAuthReq = chk_HANDLEAUTHREQ.GetState());
+ db_set_b(NULL, MODULENAME, "HideContacts", gbHideContacts = chk_HIDECONTACTS.GetState());
+ db_set_b(NULL, MODULENAME, "IgnoreContacts", gbIgnoreContacts = chk_IGNORESPAMMERS.GetState());
+ db_set_b(NULL, MODULENAME, "LogSpamToFile", gbLogToFile = chk_LOGSPAMTOFILE.GetState());
}
private:
CCtrlCheck chk_INFTALKPROT, chk_ADDPERMANENT, chk_HANDLEAUTHREQ, chk_HIDECONTACTS, chk_IGNORESPAMMERS, chk_LOGSPAMTOFILE;
@@ -85,14 +85,14 @@ public:
}
virtual void OnApply() override
{
- db_set_ws(NULL, pluginName, "question", edit_QUESTION.GetText());
- gbQuestion = DBGetContactSettingStringPAN(NULL, pluginName, "question", TranslateW(defQuestion));
- db_set_ws(NULL, pluginName, "answer", edit_ANSWER.GetText());
- gbAnswer = DBGetContactSettingStringPAN(NULL, pluginName, "answer", L"nospam");
- db_set_ws(NULL, pluginName, "authrepl", edit_AUTHREPL.GetText());
- gbAuthRepl = DBGetContactSettingStringPAN(NULL, pluginName, "authrepl", TranslateW(defAuthReply));
- db_set_ws(NULL, pluginName, "congratulation", edit_CONGRATULATION.GetText());
- gbCongratulation = DBGetContactSettingStringPAN(NULL, pluginName, "congratulation", TranslateW(defCongrats));
+ db_set_ws(NULL, MODULENAME, "question", edit_QUESTION.GetText());
+ gbQuestion = DBGetContactSettingStringPAN(NULL, MODULENAME, "question", TranslateW(defQuestion));
+ db_set_ws(NULL, MODULENAME, "answer", edit_ANSWER.GetText());
+ gbAnswer = DBGetContactSettingStringPAN(NULL, MODULENAME, "answer", L"nospam");
+ db_set_ws(NULL, MODULENAME, "authrepl", edit_AUTHREPL.GetText());
+ gbAuthRepl = DBGetContactSettingStringPAN(NULL, MODULENAME, "authrepl", TranslateW(defAuthReply));
+ db_set_ws(NULL, MODULENAME, "congratulation", edit_CONGRATULATION.GetText());
+ gbCongratulation = DBGetContactSettingStringPAN(NULL, MODULENAME, "congratulation", TranslateW(defCongrats));
}
void onClick_RESTOREDEFAULTS(CCtrlButton*)
{
@@ -143,7 +143,7 @@ public:
out << str << "\r\n";
mir_free(str);
}
- db_set_s(NULL, pluginName, "protoList", out.str().c_str());
+ db_set_s(NULL, MODULENAME, "protoList", out.str().c_str());
}
void onClick_ADD(CCtrlButton*)
{
@@ -213,38 +213,38 @@ public:
}
virtual void OnApply() override
{
- db_set_b(NULL, pluginName, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState());
- db_set_b(NULL, pluginName, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState());
+ db_set_b(NULL, MODULENAME, "CaseInsensitive", gbCaseInsensitive = chk_CASE_INSENSITIVE.GetState());
+ db_set_b(NULL, MODULENAME, "DisableInInvis", gbInvisDisable = chk_INVIS_DISABLE.GetState());
{
static wstring NewGroupName = edit_SPECIALGROUPNAME.GetText(), CurrentGroupName;
- CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"0");
+ CurrentGroupName = gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"0");
if (mir_wstrcmp(CurrentGroupName.c_str(), NewGroupName.c_str()) != 0) {
bool GroupExist = Clist_GroupExists(NewGroupName.c_str()) != NULL;
- db_set_ws(NULL, pluginName, "SpammersGroup", NewGroupName.c_str());
- gbSpammersGroup = DBGetContactSettingStringPAN(NULL, pluginName, "SpammersGroup", L"Spammers");
+ db_set_ws(NULL, MODULENAME, "SpammersGroup", NewGroupName.c_str());
+ gbSpammersGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "SpammersGroup", L"Spammers");
if (!GroupExist && gbSpecialGroup)
Clist_GroupCreate(0, gbSpammersGroup.c_str());
}
}
- db_set_b(NULL, pluginName, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState());
- db_set_b(NULL, pluginName, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState());
- db_set_b(NULL, pluginName, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState());
- db_set_b(NULL, pluginName, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState());
- db_set_b(NULL, pluginName, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState());
+ db_set_b(NULL, MODULENAME, "SpecialGroup", gbSpecialGroup = chk_SPECIALGROUP.GetState());
+ db_set_b(NULL, MODULENAME, "ExcludeContacts", gbExclude = chk_EXCLUDE.GetState());
+ db_set_b(NULL, MODULENAME, "DelExcluded", gbDelExcluded = chk_REMOVE_TMP.GetState());
+ db_set_b(NULL, MODULENAME, "DelAllTempory", gbDelAllTempory = chk_REMOVE_TMP_ALL.GetState());
+ db_set_b(NULL, MODULENAME, "IgnoreURL", gbIgnoreURL = chk_IGNOREURL.GetState());
- db_set_b(NULL, pluginName, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState());
- db_set_b(NULL, pluginName, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState());
- db_set_b(NULL, pluginName, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState());
- db_set_b(NULL, pluginName, "RegexMatch", gbRegexMatch = chk_REGEX.GetState());
- db_set_b(NULL, pluginName, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState());
- db_set_b(NULL, pluginName, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState());
+ db_set_b(NULL, MODULENAME, "AutoAuth", gbAutoAuth = chk_AUTOAUTH.GetState());
+ db_set_b(NULL, MODULENAME, "AutoAddToServerList", gbAutoAddToServerList = chk_ADDTOSRVLST.GetState());
+ db_set_b(NULL, MODULENAME, "AutoReqAuth", gbAutoReqAuth = chk_REQAUTH.GetState());
+ db_set_b(NULL, MODULENAME, "RegexMatch", gbRegexMatch = chk_REGEX.GetState());
+ db_set_b(NULL, MODULENAME, "HistoryLog", gbHistoryLog = chk_HISTORY_LOG.GetState());
+ db_set_b(NULL, MODULENAME, "MathExpression", gbMathExpression = chk_MATH_QUESTION.GetState());
{
static wstring NewAGroupName = edit_AUTOADDGROUP.GetText(), CurrentAGroupName;
- CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"0");
+ CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"0");
if (mir_wstrcmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0) {
bool GroupExist = Clist_GroupExists(NewAGroupName.c_str()) != NULL;
- db_set_ws(NULL, pluginName, "AutoAuthGroup", NewAGroupName.c_str());
- gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", L"Not Spammers");
+ db_set_ws(NULL, MODULENAME, "AutoAuthGroup", NewAGroupName.c_str());
+ gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, MODULENAME, "AutoAuthGroup", L"Not Spammers");
if (!GroupExist && gbAutoAddToServerList)
Clist_GroupCreate(0, gbAutoAuthGroup.c_str());
}