diff options
| author | Adam <Adam@anope.org> | 2017-01-27 08:40:26 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2017-01-27 08:40:26 -0500 |
| commit | 9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (patch) | |
| tree | 618a4f0e173166e6f966a7cce78f06c3c1c3299f /modules/botserv | |
| parent | 16ca76c2e7ab287e480185fbb03a0bb438351eda (diff) | |
Store CommandInfo in CommandSource instead of just command/permission
Diffstat (limited to 'modules/botserv')
| -rw-r--r-- | modules/botserv/assign.cpp | 8 | ||||
| -rw-r--r-- | modules/botserv/badwords.cpp | 10 | ||||
| -rw-r--r-- | modules/botserv/bot.cpp | 8 | ||||
| -rw-r--r-- | modules/botserv/botlist.cpp | 2 | ||||
| -rw-r--r-- | modules/botserv/control.cpp | 2 | ||||
| -rw-r--r-- | modules/botserv/kick.cpp | 8 | ||||
| -rw-r--r-- | modules/botserv/main/botserv.cpp | 16 | ||||
| -rw-r--r-- | modules/botserv/set.cpp | 6 |
8 files changed, 30 insertions, 30 deletions
diff --git a/modules/botserv/assign.cpp b/modules/botserv/assign.cpp index db368c75e..bb2d35879 100644 --- a/modules/botserv/assign.cpp +++ b/modules/botserv/assign.cpp @@ -96,7 +96,7 @@ class CommandBSAssign : public Command "Example:\n" " {command} #anope Botox\n" " Assigns the bot Botox to #anope.\n"), - "ASSIGN", "command"_kw = source.command); + "ASSIGN", "command"_kw = source.GetCommand()); return true; } }; @@ -164,7 +164,7 @@ class CommandBSUnassign : public Command "Example:\n" " {command} #anope\n" " Unassigns the current bot from #anope.\n"), - "ASSIGN", "command"_kw = source.command); + "ASSIGN", "command"_kw = source.GetCommand()); return true; } }; @@ -208,7 +208,7 @@ class CommandBSSetNoBot : public Command } else { - this->OnSyntaxError(source, source.command); + this->OnSyntaxError(source, source.GetCommand()); } } @@ -220,7 +220,7 @@ class CommandBSSetNoBot : public Command "Example:\n" " {command} #anope on\n" " Prevents a service bot from being assigned to #anope.\n"), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); return true; } }; diff --git a/modules/botserv/badwords.cpp b/modules/botserv/badwords.cpp index 071414ac4..3de381d34 100644 --- a/modules/botserv/badwords.cpp +++ b/modules/botserv/badwords.cpp @@ -388,7 +388,7 @@ class CommandBSBadwords : public Command "Examples:\n" " {command} #anope ADD raw SINGLE\n" " Adds the bad word \"raw\" to the bad word list of #anope."), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); } else if (subcommand.equals_ci("DEL")) { @@ -400,7 +400,7 @@ class CommandBSBadwords : public Command "\n" " {command} #anope DEL 2-5,7-9\n" " Removes bad words entries numbered 2 through 5 and 7 through 9 on #anope."), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); } else if (subcommand.equals_ci("LIST")) @@ -415,7 +415,7 @@ class CommandBSBadwords : public Command "\n" " {command} #anope LIST 2-5,7-9\n" " Lists bad words entries numbered 2 thorough 5 and 7 through 9 on #anope."), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); } else if (subcommand.equals_ci("CLEAR")) { @@ -425,7 +425,7 @@ class CommandBSBadwords : public Command "Example:\n" " {command} #anope CLEAR\n" " Clears the bad word list for #anope."), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); } else { @@ -448,7 +448,7 @@ class CommandBSBadwords : public Command "\n" "The \002LIST\002 and \002CLEAR\002 commands show and clear the bad words list, respectively.\n" "\002{msg}{service} {help} {command} LIST\002 and \002{msg}{service} {help} {command} CLEAR\002 for more information.\n"), - "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "command"_kw = source.command, "help"_kw = help->cname); + "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "command"_kw = source.GetCommand(), "help"_kw = help->cname); } return true; } diff --git a/modules/botserv/bot.cpp b/modules/botserv/bot.cpp index 4eb5d2069..ab48dc82e 100644 --- a/modules/botserv/bot.cpp +++ b/modules/botserv/bot.cpp @@ -394,7 +394,7 @@ class CommandBSBot : public Command "Example:\n" " {command} ADD Botox Botox services.anope.org Botox\n" " Adds a service bot with nickname \"Botox\", username \"Botox\", hostname \"services.anope.org\", and realname \"Botox\" to the bot list."), - "botserv/bot/add", "command"_kw = source.command); + "botserv/bot/add", "command"_kw = source.GetCommand()); else if (subcommand.equals_ci("CHANGE")) source.Reply(_("\002{command} CHANGE\002 allows changing the \037nickname\037, \037username\037, \037hostname\037 and \037realname\037 of bot \037oldnickname\037." " If a new username, hostname, or realname is specified, then the bot \037nickname\037 will quit and rejoin all of its channels using the new mask." @@ -404,7 +404,7 @@ class CommandBSBot : public Command "Example:\n" " {command} CHANGE Botox peer connection reset.by peer\n" " Renames the bot \"Botox\" to \"peer\" with the given username, hostname, and realname."), - "botserv/bot/change", "command"_kw = source.command); + "botserv/bot/change", "command"_kw = source.GetCommand()); else if (subcommand.equals_ci("DEL")) source.Reply(_("\002{command} DEL\002 removes the bot \037nickname\037 from the bot list. The bot will quit from any channels it is in, and will not be replaced." " This command requires the operator privilege for command \002{0}\002.\n" @@ -412,7 +412,7 @@ class CommandBSBot : public Command "Example:\n" " {command} DEL peer\n" " Removes the bot \"peer\" from the bot list."), - "botserv/bot/del", "command"_kw = source.command); + "botserv/bot/del", "command"_kw = source.GetCommand()); else { source.Reply(_("Allows Services Operators to create, modify, and delete bots that users will be able to use on their channels.")); @@ -428,7 +428,7 @@ class CommandBSBot : public Command "\n" "The \002{command} DEL\002 removes the bot \037nickname\037 from the bot list.\n" "\002{msg}{service} {help} {command} DEL\002 for more information."), - "msg"_kw = Config->StrictPrivmsg, "help"_kw = help->cname, "command"_kw = source.command); + "msg"_kw = Config->StrictPrivmsg, "help"_kw = help->cname, "command"_kw = source.GetCommand()); } return true; } diff --git a/modules/botserv/botlist.cpp b/modules/botserv/botlist.cpp index 6c12a2c59..e9ce213a6 100644 --- a/modules/botserv/botlist.cpp +++ b/modules/botserv/botlist.cpp @@ -80,7 +80,7 @@ class CommandBSBotList : public Command source.Reply(_("\n" "Example:\n" " {command} BOTLIST"), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); return true; } }; diff --git a/modules/botserv/control.cpp b/modules/botserv/control.cpp index 1785e65e9..6a8edc200 100644 --- a/modules/botserv/control.cpp +++ b/modules/botserv/control.cpp @@ -155,7 +155,7 @@ class CommandBSAct : public Command "Example:\n" " {command} #anope slaps Cronus\n" " Shows the assigned service bot \"slapping\" Cronus."), - "command"_kw = source.command); + "command"_kw = source.GetCommand()); return true; } }; diff --git a/modules/botserv/kick.cpp b/modules/botserv/kick.cpp index 745525fa3..84939c963 100644 --- a/modules/botserv/kick.cpp +++ b/modules/botserv/kick.cpp @@ -533,7 +533,7 @@ class CommandBSKick : public Command "\n" "Available kickers:")); - 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; @@ -544,7 +544,7 @@ class CommandBSKick : public Command ServiceReference<Command> command(info.name); if (command) { - source.command = c_name; + source.SetCommand(c_name); command->OnServHelp(source); } } @@ -1114,7 +1114,7 @@ class CommandBSSetDontKickOps : public Command } else { - this->OnSyntaxError(source, source.command); + this->OnSyntaxError(source, source.GetCommand()); } } @@ -1180,7 +1180,7 @@ class CommandBSSetDontKickVoices : public Command } else { - this->OnSyntaxError(source, source.command); + this->OnSyntaxError(source, source.GetCommand()); } } diff --git a/modules/botserv/main/botserv.cpp b/modules/botserv/main/botserv.cpp index 4b0309b31..522b55489 100644 --- a/modules/botserv/main/botserv.cpp +++ b/modules/botserv/main/botserv.cpp @@ -158,29 +158,29 @@ class BotServCore : public Module, public BotServ::BotServService if (source.c) { - source.Reply(_("\002%s\002 allows you to execute \"fantasy\" commands in the channel.\n" + source.Reply(_("\002{0}\002 allows you to execute \"fantasy\" commands in the channel.\n" "Fantasy commands are commands that can be executed from messaging a\n" "channel, and provide a more convenient way to execute commands. Commands that\n" "require a channel as a parameter will automatically have that parameter\n" - "given.\n"), source.service->nick.c_str()); + "given.\n"), source.service->nick); const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_(" \n" - "Fantasy commands may be prefixed with one of the following characters: %s\n"), fantasycharacters.c_str()); + "Fantasy commands may be prefixed with one of the following characters: {0}\n"), fantasycharacters); source.Reply(_(" \n" "Available commands are:")); } else if (*source.service == BotServ) { - source.Reply(_("\002%s\002 allows you to have a bot on your own channel.\n" + source.Reply(_("\002{0}\002 allows you to have a bot on your own channel.\n" "It has been created for users that can't host or\n" "configure a bot, or for use on networks that don't\n" "allow user bots. Available commands are listed\n" - "below; to use them, type \002%s%s \037command\037\002. For\n" + "below; to use them, type \002{1}{2} \037command\037\002. For\n" "more information on a specific command, type\n" - "\002%s%s %s \037command\037\002.\n"), - BotServ->nick.c_str(), Config->StrictPrivmsg.c_str(), BotServ->nick.c_str(), - Config->StrictPrivmsg.c_str(), BotServ->nick.c_str(), source.command.c_str()); + "\002{3}{4} {5} \037command\037\002.\n"), + BotServ->nick, Config->StrictPrivmsg, BotServ->nick, + Config->StrictPrivmsg, BotServ->nick, source.GetCommand()); } return EVENT_CONTINUE; diff --git a/modules/botserv/set.cpp b/modules/botserv/set.cpp index 6845281cb..da3b42f92 100644 --- a/modules/botserv/set.cpp +++ b/modules/botserv/set.cpp @@ -41,7 +41,7 @@ class CommandBSSet : public Command "Available options:")); bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"), hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands"); - 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; @@ -58,7 +58,7 @@ class CommandBSSet : public Command if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) continue; - source.command = it->first; + source.SetCommand(it->first); command->OnServHelp(source); } } @@ -192,7 +192,7 @@ class CommandBSSetPrivate : public Command } else { - this->OnSyntaxError(source, source.command); + this->OnSyntaxError(source, source.GetCommand()); } } |
