summaryrefslogtreecommitdiff
path: root/modules/operserv
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-01-27 08:40:26 -0500
committerAdam <Adam@anope.org>2017-01-27 08:40:26 -0500
commit9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (patch)
tree618a4f0e173166e6f966a7cce78f06c3c1c3299f /modules/operserv
parent16ca76c2e7ab287e480185fbb03a0bb438351eda (diff)
Store CommandInfo in CommandSource instead of just command/permission
Diffstat (limited to 'modules/operserv')
-rw-r--r--modules/operserv/akill.cpp10
-rw-r--r--modules/operserv/dns.cpp2
-rw-r--r--modules/operserv/ignore.cpp2
-rw-r--r--modules/operserv/logsearch.cpp2
-rw-r--r--modules/operserv/session.cpp4
-rw-r--r--modules/operserv/shutdown.cpp4
-rw-r--r--modules/operserv/sxline.cpp46
7 files changed, 35 insertions, 35 deletions
diff --git a/modules/operserv/akill.cpp b/modules/operserv/akill.cpp
index 10a87db2b..0af4a36c5 100644
--- a/modules/operserv/akill.cpp
+++ b/modules/operserv/akill.cpp
@@ -399,7 +399,7 @@ class CommandOSAKill : public Command
" If a unit specifier is not included, the default is days, so \037+30\037 means 30 days."
" To add an auto kill which does not expire, use \037+0\037. "
" The default auto kill expiry time is \002{1}\002"),
- source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d"), source.GetAccount()));
+ source.GetCommand(), Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("autokillexpiry", "30d"), source.GetAccount()));
const Anope::string &regexengine = Config->GetBlock("options")->Get<Anope::string>("regexengine");
if (!regexengine.empty())
@@ -411,7 +411,7 @@ class CommandOSAKill : public Command
else if (subcommand.equals_ci("DEL"))
source.Reply(_("The \002{0} DEL\002 command removes the given \037mask\037 from the auto kill list, if present."
" If a list of entry numbers is given, those entries are deleted."),
- source.command);
+ source.GetCommand());
else if (subcommand.equals_ci("LIST") || subcommand.equals_ci("VIEW"))
source.Reply(_("The \002{0} LIST\002 and \002{0} VIEW\002 commands display the auto kill list."
" If a wildcard \037mask\037 is given, only those entries matching the mask are displayed."
@@ -422,10 +422,10 @@ class CommandOSAKill : public Command
"\n"
" {0} LIST 2-5,7-9\n"
" Lists auto kill entries numbered 2 through 5 and 7 through 9."),
- source.command);
+ source.GetCommand());
else if (subcommand.equals_ci("CLEAR"))
source.Reply(_("The \002{0} CLEAR\002 command removes all auto kills from the auto kill list."),
- source.command);
+ source.GetCommand());
else
{
CommandInfo *help = source.service->FindCommand("generic/help");
@@ -443,7 +443,7 @@ class CommandOSAKill : public Command
"\n"
"The \002CLEAR\002 command clears th auto kill list."
"\002{msg}{service} {help} {command} CLEAR\002 for more information.\n"),
- "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.command);
+ "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.GetCommand());
}
return true;
}
diff --git a/modules/operserv/dns.cpp b/modules/operserv/dns.cpp
index 8efa94fa9..b485ae440 100644
--- a/modules/operserv/dns.cpp
+++ b/modules/operserv/dns.cpp
@@ -815,7 +815,7 @@ class CommandOSDNS : public Command
"The \002{0} ADDIP\002 command associates an IP with a server.\n"
" \n"
"The \002{0} POOL\002 and \002{0} DEPOOL\002 commands actually add and remove servers to their given zones."),
- source.command);
+ source.GetCommand());
return true;
}
};
diff --git a/modules/operserv/ignore.cpp b/modules/operserv/ignore.cpp
index afdd36837..a5c39135d 100644
--- a/modules/operserv/ignore.cpp
+++ b/modules/operserv/ignore.cpp
@@ -375,7 +375,7 @@ class CommandOSIgnore : public Command
" If a unit specifier is not included, the default is seconds."
" To make services permanently ignore the user, use 0 as the expiry time."
" When adding a \037mask\037, it should be in the format nick!user@host, everything else will be considered a nicknames. Wildcards are permitted."),
- source.command);
+ source.GetCommand());
const Anope::string &regexengine = Config->GetBlock("options")->Get<Anope::string>("regexengine");
if (!regexengine.empty())
diff --git a/modules/operserv/logsearch.cpp b/modules/operserv/logsearch.cpp
index 702abe0e0..e936a8f6d 100644
--- a/modules/operserv/logsearch.cpp
+++ b/modules/operserv/logsearch.cpp
@@ -142,7 +142,7 @@ class CommandOSLogSearch : public Command
"Example:\n"
" {0} +21d +500l Anope\n"
" Searches the last 21 days worth of logs for messages containing \"Anope\" and lists the most recent 500 of them."),
- source.command);
+ source.GetCommand());
return true;
}
};
diff --git a/modules/operserv/session.cpp b/modules/operserv/session.cpp
index cb22f65b9..0b6f207a5 100644
--- a/modules/operserv/session.cpp
+++ b/modules/operserv/session.cpp
@@ -324,7 +324,7 @@ class CommandOSSession : public Command
"\002{0} VIEW\002 displays detailed information about a specific host - including the current session count and session limit.\n"
"\n"
"See the \002EXCEPTION\002 help for more information about session limiting and how to set session limits specific to certain hosts and groups thereof."), // XXX
- source.command);
+ source.GetCommand());
return true;
}
};
@@ -611,7 +611,7 @@ class CommandOSException : public Command
" This determines how many sessions this host may carry at a time."
" A value of zero means the host has an unlimited session limit."
" If more than one entry matches a client, the first matching enty will be used."),
- source.command);
+ source.GetCommand());
else
source.Reply(_("Allows you to manipulate the list of hosts that have specific session limits - allowing certain machines, such as shell servers, to carry more than the default number of clients at a time."
" Once a host reaches its session limit, all clients attempting to connect from that host will be killed."
diff --git a/modules/operserv/shutdown.cpp b/modules/operserv/shutdown.cpp
index de987537f..4e0b0a162 100644
--- a/modules/operserv/shutdown.cpp
+++ b/modules/operserv/shutdown.cpp
@@ -30,7 +30,7 @@ class CommandOSRestart : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
logger.Command(LogType::ADMIN, source, _("{source} used {command}"));
- Anope::QuitReason = source.command + " command received from " + source.GetNick();
+ Anope::QuitReason = source.GetCommand() + " command received from " + source.GetNick();
Anope::Quitting = Anope::Restarting = true;
}
@@ -52,7 +52,7 @@ class CommandOSShutdown : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
logger.Command(LogType::ADMIN, source, _("{source} used {command}"));
- Anope::QuitReason = source.command + " command received from " + source.GetNick();
+ Anope::QuitReason = source.GetCommand() + " command received from " + source.GetNick();
Anope::Quitting = true;
}
diff --git a/modules/operserv/sxline.cpp b/modules/operserv/sxline.cpp
index 47133c16e..59b1c4223 100644
--- a/modules/operserv/sxline.cpp
+++ b/modules/operserv/sxline.cpp
@@ -30,7 +30,7 @@ class CommandOSSXLineBase : public Command
{
if (!this->xlm() || this->xlm()->GetXLines().empty())
{
- source.Reply(_("{0} list is empty."), source.command);
+ source.Reply(_("{0} list is empty."), source.GetCommand());
return;
}
@@ -62,11 +62,11 @@ class CommandOSSXLineBase : public Command
[&]()
{
if (!deleted)
- source.Reply(_("No matching entries on the {0} list."), source.command);
+ source.Reply(_("No matching entries on the {0} list."), source.GetCommand());
else if (deleted == 1)
- source.Reply(_("Deleted \0021\002 entry from the {0} list."), source.command);
+ source.Reply(_("Deleted \0021\002 entry from the {0} list."), source.GetCommand());
else
- source.Reply(_("Deleted \002{0}\002 entries from the {1} list."), deleted, source.command);
+ source.Reply(_("Deleted \002{0}\002 entries from the {1} list."), deleted, source.GetCommand());
});
}
else
@@ -75,13 +75,13 @@ class CommandOSSXLineBase : public Command
if (!x)
{
- source.Reply(_("\002{0}\002 not found on the {1] list."), mask, source.command);
+ source.Reply(_("\002{0}\002 not found on the {1] list."), mask, source.GetCommand());
return;
}
EventManager::Get()->Dispatch(&Event::DelXLine::OnDelXLine, source, x, this->xlm());
- source.Reply(_("\002{0}\002 deleted from the {1} list."), x->GetMask(), source.command);
+ source.Reply(_("\002{0}\002 deleted from the {1} list."), x->GetMask(), source.GetCommand());
logger.Command(LogType::ADMIN, source, _("{source} used {command} to remove {0} from the list"), x->GetMask());
@@ -96,7 +96,7 @@ class CommandOSSXLineBase : public Command
{
if (!this->xlm() || this->xlm()->GetXLines().empty())
{
- source.Reply(_("{0} list is empty."), source.command);
+ source.Reply(_("{0} list is empty."), source.GetCommand());
return;
}
@@ -146,11 +146,11 @@ class CommandOSSXLineBase : public Command
if (list.IsEmpty())
{
- source.Reply(_("No matching entries on the {0} list."), source.command);
+ source.Reply(_("No matching entries on the {0} list."), source.GetCommand());
}
else
{
- source.Reply(_("{0} list:"), source.command);
+ source.Reply(_("{0} list:"), source.GetCommand());
std::vector<Anope::string> replies;
list.Process(replies);
@@ -188,7 +188,7 @@ class CommandOSSXLineBase : public Command
logger.Command(LogType::ADMIN, source, _("{source} used {command} to CLEAR the list"));
- source.Reply(_("The {0} list has been cleared."), source.command);
+ source.Reply(_("The {0} list has been cleared."), source.GetCommand());
if (Anope::ReadOnly)
source.Reply(_("Services are in read-only mode. Any changes made may not persist."));
}
@@ -199,7 +199,7 @@ class CommandOSSXLineBase : public Command
const Anope::string GetDesc(CommandSource &source) const override
{
- return Anope::printf(Language::Translate(source.GetAccount(), _("Manipulate the %s list")), source.command.upper().c_str());
+ return Anope::Format(Language::Translate(source.GetAccount(), _("Manipulate the {0} list")), source.GetCommand().upper());
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
@@ -347,7 +347,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
source.Reply(_("\002{0}\002 coverage is too wide; please use a more specific mask."), mask);
logger.Command(LogType::ADMIN, source, _("{source} used {command} and tried to {0} {1}% of the network ({2} users)"),
- source.command, percent, affected);
+ source.GetCommand(), percent, affected);
x->Delete();
return;
@@ -378,7 +378,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
this->xlm()->Send(NULL, x);
}
- source.Reply(_("\002{0}\002 added to the {1} list."), mask, source.command);
+ source.Reply(_("\002{0}\002 added to the {1} list."), mask, source.GetCommand());
logger.Command(LogType::ADMIN, source, _("{source} used {command} on {0} ({1}), expires in {2} [affects {3} user(s) ({4}%)]"),
mask, reason, expires ? Anope::Duration(expires - Anope::CurTime) : "never",
@@ -410,7 +410,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
" To add a {0} which does not expire, use \037+0\037."
" The default {0} expiry time is \002{1}\002."
" Because the real name may contain spaces, the separator between it and the reason is a \002colon\002."),
- source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("snlineexpiry", "30d"), source.GetAccount()));
+ source.GetCommand(), Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("snlineexpiry", "30d"), source.GetAccount()));
const Anope::string &regexengine = Config->GetBlock("options")->Get<Anope::string>("regexengine");
if (!regexengine.empty())
@@ -435,12 +435,12 @@ class CommandOSSNLine : public CommandOSSXLineBase
"\n"
" {0} LIST 2-5,7-9\n"
" Lists {0} entries numbered 2 through 5 and 7 through 9.\n"),
- source.command);
+ source.GetCommand());
}
else if (subcommand.equals_ci("CLEAR"))
{
source.Reply(_("\002{0} CLEAR\002 removes all entries from the {0} list."),
- source.command);
+ source.GetCommand());
}
else
{
@@ -460,7 +460,7 @@ class CommandOSSNLine : public CommandOSSXLineBase
"\n"
"The \002CLEAR\002 command clears th auto kill list."
"\002{msg}{service} {help} {command} CLEAR\002 for more information.\n"),
- "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.command);
+ "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.GetCommand());
}
return true;
}
@@ -571,7 +571,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
{
source.Reply(_("\002{0}\002 coverage is too wide; please use a more specific mask."), mask);
- logger.Command(LogType::ADMIN, source, _("{source} used {command} and tried to {0} {1}% of the network ({2} users)"), source.command, percent, affected);
+ logger.Command(LogType::ADMIN, source, _("{source} used {command} and tried to {0} {1}% of the network ({2} users)"), source.GetCommand(), percent, affected);
x->Delete();
return;
@@ -628,7 +628,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
this->xlm()->Send(NULL, x);
}
- source.Reply(_("\002{0}\002 added to the {1} list."), mask, source.command);
+ source.Reply(_("\002{0}\002 added to the {1} list."), mask, source.GetCommand());
logger.Command(LogType::ADMIN, source, _("{source} used {command} on {0} ({1}), expires in {2} [affects {3} user(s) ({4}%)]"),
mask, x->GetReason(), expires ? Anope::Duration(expires - Anope::CurTime) : "never", affected, percent);
@@ -658,7 +658,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
" If a unit specifier is not included, the default is days, so \037+30\037 by itself means 30 days."
" To add a {0} which does not expire, use \037+0\037."
" The default {0} expiry time is \002{1}\002."),
- source.command, Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("sqlineexpiry", "30d"), source.GetAccount()));
+ source.GetCommand(), Anope::Duration(Config->GetModule("operserv/main")->Get<time_t>("sqlineexpiry", "30d"), source.GetAccount()));
const Anope::string &regexengine = Config->GetBlock("options")->Get<Anope::string>("regexengine");
if (!regexengine.empty())
@@ -683,12 +683,12 @@ class CommandOSSQLine : public CommandOSSXLineBase
"\n"
" {0} LIST 2-5,7-9\n"
" Lists {0} entries numbered 2 through 5 and 7 through 9.\n"),
- source.command);
+ source.GetCommand());
}
else if (subcommand.equals_ci("CLEAR"))
{
source.Reply(_("\002{0} CLEAR\002 removes all entries from the {0} list."),
- source.command);
+ source.GetCommand());
}
else
{
@@ -709,7 +709,7 @@ class CommandOSSQLine : public CommandOSSXLineBase
"\n"
"The \002CLEAR\002 command clears th auto kill list."
"\002{msg}{service} {help} {command} CLEAR\002 for more information.\n"),
- "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.command);
+ "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "help"_kw = help->cname, "command"_kw = source.GetCommand());
}
return true;
}