summaryrefslogtreecommitdiff
path: root/modules/nickserv
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/nickserv
parent16ca76c2e7ab287e480185fbb03a0bb438351eda (diff)
Store CommandInfo in CommandSource instead of just command/permission
Diffstat (limited to 'modules/nickserv')
-rw-r--r--modules/nickserv/access.cpp4
-rw-r--r--modules/nickserv/group.cpp4
-rw-r--r--modules/nickserv/main/nickserv.cpp12
-rw-r--r--modules/nickserv/recover.cpp4
-rw-r--r--modules/nickserv/register.cpp2
-rw-r--r--modules/nickserv/set.cpp14
-rw-r--r--modules/nickserv/set_misc.cpp10
7 files changed, 25 insertions, 25 deletions
diff --git a/modules/nickserv/access.cpp b/modules/nickserv/access.cpp
index 8c6ac0343..53cb84055 100644
--- a/modules/nickserv/access.cpp
+++ b/modules/nickserv/access.cpp
@@ -206,7 +206,7 @@ class CommandNSAccess : public Command
if (!mask.empty() && (mask.find('@') == Anope::string::npos || mask.find('!') != Anope::string::npos))
{
source.Reply(_("Mask must be in the form \037user\037@\037host\037."));
- source.Reply(_("\002%s%s HELP %s\002 for more information."), Config->StrictPrivmsg, source.service->nick, source.command); // XXX
+ source.Reply(_("\002%s%s HELP %s\002 for more information."), Config->StrictPrivmsg, source.service->nick, source.GetCommand()); // XXX
return;
}
@@ -241,7 +241,7 @@ class CommandNSAccess : public Command
"\n"
" {command} LIST\n"
" Displays the current access list."),
- source.command, source.service->nick);
+ source.GetCommand(), source.service->nick);
return true;
}
};
diff --git a/modules/nickserv/group.cpp b/modules/nickserv/group.cpp
index cff53d320..5b69b449a 100644
--- a/modules/nickserv/group.cpp
+++ b/modules/nickserv/group.cpp
@@ -146,7 +146,7 @@ class CommandNSGroup : public Command
if (Anope::CurTime < u->lastnickreg + reg_delay)
{
- source.Reply(_("Please wait \002{0}\002 seconds before using the \002{1}\002 command again."), (reg_delay + u->lastnickreg) - Anope::CurTime, source.command);
+ source.Reply(_("Please wait \002{0}\002 seconds before using the \002{1}\002 command again."), (reg_delay + u->lastnickreg) - Anope::CurTime, source.GetCommand());
return;
}
@@ -365,7 +365,7 @@ class CommandNSGList : public Command
"\n"
"With a parameter, lists all nicknames that are in the group of the given nick.\n"
"Specifying a nick is limited to \002Services Operators\002."),
- source.command);
+ source.GetCommand());
else
source.Reply(_("Lists all nicknames in your group."));
diff --git a/modules/nickserv/main/nickserv.cpp b/modules/nickserv/main/nickserv.cpp
index 3921534c9..95af33297 100644
--- a/modules/nickserv/main/nickserv.cpp
+++ b/modules/nickserv/main/nickserv.cpp
@@ -573,18 +573,18 @@ class NickServCore : public Module, public NickServ::NickServService
if (!params.empty() || source.c || source.service != *NickServ)
return EVENT_CONTINUE;
if (!Config->GetModule("nickserv/main")->Get<bool>("nonicknameownership"))
- source.Reply(_("\002%s\002 allows you to register a nickname and\n"
+ source.Reply(_("\002{0}\002 allows you to register a nickname and\n"
"prevent others from using it. The following\n"
"commands allow for registration and maintenance of\n"
- "nicknames; to use them, type \002%s%s \037command\037\002.\n"
+ "nicknames; to use them, type \002{1}{2} \037command\037\002.\n"
"For more information on a specific command, type\n"
- "\002%s%s %s \037command\037\002.\n"), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), source.command.c_str());
+ "\002{3}{4} {5} \037command\037\002.\n"), NickServ->nick, Config->StrictPrivmsg, NickServ->nick, Config->StrictPrivmsg, NickServ->nick, source.GetCommand());
else
- source.Reply(_("\002%s\002 allows you to register an account.\n"
+ source.Reply(_("\002{0}\002 allows you to register an account.\n"
"The following commands allow for registration and maintenance of\n"
- "accounts; to use them, type \002%s%s \037command\037\002.\n"
+ "accounts; to use them, type \002{1}{2} \037command\037\002.\n"
"For more information on a specific command, type\n"
- "\002%s%s %s \037command\037\002.\n"), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), source.command.c_str());
+ "\002{3}{4} {5} \037command\037\002.\n"), NickServ->nick, Config->StrictPrivmsg, NickServ->nick, Config->StrictPrivmsg, NickServ->nick, source.GetCommand());
return EVENT_CONTINUE;
}
diff --git a/modules/nickserv/recover.cpp b/modules/nickserv/recover.cpp
index 191e6e019..5c4f3ac1d 100644
--- a/modules/nickserv/recover.cpp
+++ b/modules/nickserv/recover.cpp
@@ -86,7 +86,7 @@ class NSRecoverRequestListener : public NickServ::IdentifyRequestListener
u->SendMessage(*source.service, _("This nickname has been recovered by \002{0}\002. If you did not do this, then \002{0}\002 may have your password, and you should change it."),
source.GetNick());
- Anope::string buf = source.command.upper() + " command used by " + source.GetNick();
+ Anope::string buf = source.GetCommand().upper() + " command used by " + source.GetNick();
u->Kill(*source.service, buf);
source.Reply(_("Ghost with your nick has been killed."));
@@ -172,7 +172,7 @@ class CommandNSRecover : public Command
if (user && source.GetUser() == user)
{
- source.Reply(_("You can't %s yourself!"), source.command.lower().c_str());
+ source.Reply(_("You can't {0} yourself!"), source.GetCommand().lower());
return;
}
diff --git a/modules/nickserv/register.cpp b/modules/nickserv/register.cpp
index 1554c0033..6ddae499d 100644
--- a/modules/nickserv/register.cpp
+++ b/modules/nickserv/register.cpp
@@ -202,7 +202,7 @@ class CommandNSRegister : public Command
if (u && Anope::CurTime < u->lastnickreg + reg_delay)
{
- source.Reply(_("Please wait \002{0}\002 seconds before using the {1} command again."), (u->lastnickreg + reg_delay) - Anope::CurTime, source.command);
+ source.Reply(_("Please wait \002{0}\002 seconds before using the {1} command again."), (u->lastnickreg + reg_delay) - Anope::CurTime, source.GetCommand());
return;
}
diff --git a/modules/nickserv/set.cpp b/modules/nickserv/set.cpp
index df6696fbf..f38422d48 100644
--- a/modules/nickserv/set.cpp
+++ b/modules/nickserv/set.cpp
@@ -42,7 +42,7 @@ class CommandNSSet : public Command
"\n"
"Available options:"));
- Anope::string this_name = source.command;
+ Anope::string this_name = source.GetCommand();
bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"),
hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands");
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
@@ -62,7 +62,7 @@ class CommandNSSet : public Command
else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission))
continue;
- source.command = c_name;
+ source.SetCommand(c_name);
c->OnServHelp(source);
}
}
@@ -97,7 +97,7 @@ class CommandNSSASet : public Command
"\n"
"Available options:"));
- Anope::string this_name = source.command;
+ Anope::string this_name = source.GetCommand();
for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
{
const Anope::string &c_name = it->first;
@@ -108,7 +108,7 @@ class CommandNSSASet : public Command
ServiceReference<Command> command(info.name);
if (command)
{
- source.command = c_name;
+ source.SetCommand(c_name);
command->OnServHelp(source);
}
}
@@ -881,7 +881,7 @@ class CommandNSSetMessage : public Command
if (!Config->GetBlock("options")->Get<bool>("useprivmsg"))
{
- source.Reply(_("You cannot %s on this network."), source.command);
+ source.Reply(_("You cannot {0} on this network."), source.GetCommand());
return;
}
@@ -919,7 +919,7 @@ class CommandNSSetMessage : public Command
bool OnHelp(CommandSource &source, const Anope::string &) override
{
- Anope::string cmd = source.command;
+ Anope::string cmd = source.GetCommand();
size_t i = cmd.find_last_of(' ');
if (i != Anope::string::npos)
cmd = cmd.substr(i + 1);
@@ -946,7 +946,7 @@ class CommandNSSASetMessage : public CommandNSSetMessage
bool OnHelp(CommandSource &source, const Anope::string &) override
{
- Anope::string cmd = source.command;
+ Anope::string cmd = source.GetCommand();
size_t i = cmd.find_last_of(' ');
if (i != Anope::string::npos)
cmd = cmd.substr(i + 1);
diff --git a/modules/nickserv/set_misc.cpp b/modules/nickserv/set_misc.cpp
index fe1859cc7..6e8fdc378 100644
--- a/modules/nickserv/set_misc.cpp
+++ b/modules/nickserv/set_misc.cpp
@@ -124,7 +124,7 @@ class CommandNSSetMisc : public Command
if (MOD_RESULT == EVENT_STOP)
return;
- Anope::string scommand = GetAttribute(source.command);
+ Anope::string scommand = GetAttribute(source.GetCommand());
/* remove existing */
for (NSMiscData *data : nc->GetRefs<NSMiscData *>())
@@ -156,18 +156,18 @@ class CommandNSSetMisc : public Command
void OnServHelp(CommandSource &source) override
{
- if (descriptions.count(source.command))
+ if (descriptions.count(source.GetCommand()))
{
- this->SetDesc(descriptions[source.command]);
+ this->SetDesc(descriptions[source.GetCommand()]);
Command::OnServHelp(source);
}
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
- if (descriptions.count(source.command))
+ if (descriptions.count(source.GetCommand()))
{
- source.Reply(Language::Translate(source.nc, descriptions[source.command].c_str()));
+ source.Reply(Language::Translate(source.nc, descriptions[source.GetCommand()]));
return true;
}
return false;