1
0
mirror of https://github.com/anope/anope.git synced 2026-07-01 03:26:38 +02:00

Rewrote the ignore code. Adds creator and reason to /os ignore list.

This commit is contained in:
Adam
2010-12-23 18:39:54 -05:00
parent 265006b691
commit 3009540a00
14 changed files with 250 additions and 356 deletions
-35
View File
@@ -22,8 +22,6 @@ class CommandOSSet : public Command
LanguageString index;
index = allow_ignore ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
source.Reply(index, "IGNORE");
index = readonly ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
source.Reply(index, "READONLY");
index = debug ? OPER_SET_LIST_OPTION_ON : OPER_SET_LIST_OPTION_OFF;
@@ -34,35 +32,6 @@ class CommandOSSet : public Command
return MOD_CONT;
}
CommandReturn DoSetIgnore(CommandSource &source, const std::vector<Anope::string> &params)
{
User *u = source.u;
const Anope::string &setting = params.size() > 1 ? params[1] : "";
if (setting.empty())
{
this->OnSyntaxError(source, "IGNORE");
return MOD_CONT;
}
if (setting.equals_ci("ON"))
{
Log(LOG_ADMIN, u, this) << "ON";
allow_ignore = 1;
source.Reply(OPER_SET_IGNORE_ON);
}
else if (setting.equals_ci("OFF"))
{
Log(LOG_ADMIN, u, this) << "OFF";
allow_ignore = 0;
source.Reply(OPER_SET_IGNORE_OFF);
}
else
source.Reply(OPER_SET_IGNORE_ERROR);
return MOD_CONT;
}
CommandReturn DoSetReadOnly(CommandSource &source, const std::vector<Anope::string> &params)
{
User *u = source.u;
@@ -204,8 +173,6 @@ class CommandOSSet : public Command
if (option.equals_ci("LIST"))
return this->DoList(source);
else if (option.equals_ci("IGNORE"))
return this->DoSetIgnore(source, params);
else if (option.equals_ci("READONLY"))
return this->DoSetReadOnly(source, params);
else if (option.equals_ci("SUPERADMIN"))
@@ -230,8 +197,6 @@ class CommandOSSet : public Command
source.Reply(OPER_HELP_SET_READONLY);
else if (subcommand.equals_ci("NOEXPIRE"))
source.Reply(OPER_HELP_SET_NOEXPIRE);
else if (subcommand.equals_ci("IGNORE"))
source.Reply(OPER_HELP_SET_IGNORE);
else if (subcommand.equals_ci("SUPERADMIN"))
source.Reply(OPER_HELP_SET_SUPERADMIN);
else