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/chanserv | |
| parent | 16ca76c2e7ab287e480185fbb03a0bb438351eda (diff) | |
Store CommandInfo in CommandSource instead of just command/permission
Diffstat (limited to 'modules/chanserv')
| -rw-r--r-- | modules/chanserv/access.cpp | 16 | ||||
| -rw-r--r-- | modules/chanserv/akick.cpp | 12 | ||||
| -rw-r--r-- | modules/chanserv/entrymsg.cpp | 2 | ||||
| -rw-r--r-- | modules/chanserv/flags.cpp | 2 | ||||
| -rw-r--r-- | modules/chanserv/list.cpp | 2 | ||||
| -rw-r--r-- | modules/chanserv/log.cpp | 2 | ||||
| -rw-r--r-- | modules/chanserv/main/chanserv.cpp | 10 | ||||
| -rw-r--r-- | modules/chanserv/mode.cpp | 8 | ||||
| -rw-r--r-- | modules/chanserv/set.cpp | 32 | ||||
| -rw-r--r-- | modules/chanserv/set_misc.cpp | 12 | ||||
| -rw-r--r-- | modules/chanserv/topic.cpp | 2 | ||||
| -rw-r--r-- | modules/chanserv/xop.cpp | 64 |
12 files changed, 82 insertions, 82 deletions
diff --git a/modules/chanserv/access.cpp b/modules/chanserv/access.cpp index 6ad67733e..36307c52f 100644 --- a/modules/chanserv/access.cpp +++ b/modules/chanserv/access.cpp @@ -553,7 +553,7 @@ class CommandCSAccess : public Command " The \037level\037 may be a numerical level between \002{1}\002 and \002{2}\002 or the name of a privilege (eg. \002{3}\002)." " The privilege set granted to a given user is the union of the privileges of access entries that match the user." " Use of this command requires the \002{4}\002 privilege on \037channel\037."), - source.command, ChanServ::ACCESS_INVALID + 1, ChanServ::ACCESS_FOUNDER - 1, "AUTOOP", "ACCESS_CHANGE"); + source.GetCommand(), ChanServ::ACCESS_INVALID + 1, ChanServ::ACCESS_FOUNDER - 1, "AUTOOP", "ACCESS_CHANGE"); if (!Config->GetModule("chanserv/main")->Get<bool>("disallow_channel_access")) source.Reply(_("The given \037mask\037 may also be a channel, which will use the access list from the other channel up to the given \037level\037.")); @@ -577,7 +577,7 @@ class CommandCSAccess : public Command "Example:\n" " {command} #anope del DukePyrolator\n" " Removes the access of \"DukePyrolator\" from \"#anope\"."), - source.command, "ACCESS_CHANGE"); + source.GetCommand(), "ACCESS_CHANGE"); else if (subcommand.equals_ci("LIST") || subcommand.equals_ci("VIEW")) source.Reply(_("The \002{0} LIST\002 and \002{0} VIEW\002 command displays the access list of \037channel\037." " If a wildcard mask is given, only those entries matching the mask are displayed." @@ -588,11 +588,11 @@ class CommandCSAccess : public Command "Example:\n" " {0} #anope LIST 2-5,7-9\n" " Lists access entries numbered 2 through 5 and 7 through 9 on #anope."), - source.command, "ACCESS_LIST"); + source.GetCommand(), "ACCESS_LIST"); else if (subcommand.equals_ci("CLEAR")) source.Reply(_("The \002{0} CLEAR\002 command clears the access list of \037channel\037." " Use of this command requires the \002{1}\002 privilege on \037channel\037."), - source.command, "FOUNDER"); + source.GetCommand(), "FOUNDER"); else { @@ -624,7 +624,7 @@ class CommandCSAccess : public Command "The \002CLEAR\002 command clears the access list." "Use of this command requires the \002{founder}\002 privilege on \037channel\037.\n" "\002{msg}{service} {help} {command} CLEAR\002 for more information."), - "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "command"_kw = source.command, + "msg"_kw = Config->StrictPrivmsg, "service"_kw = source.service->nick, "command"_kw = source.GetCommand(), "help"_kw = help->cname, "change"_kw = "ACCESS_CHANGE", "list"_kw = "ACCESS_LIST", "founder"_kw = "FOUNDER"); } @@ -668,7 +668,7 @@ class CommandCSLevels : public Command CommandInfo *help = source.service->FindCommand("generic/help"); if (help) source.Reply(_("There is no such privilege \002{0}\002. See \002{0}{1} {2} {3}\002 for a list of valid settings."), - what, Config->StrictPrivmsg, source.service->nick, help->cname, source.command); + what, Config->StrictPrivmsg, source.service->nick, help->cname, source.GetCommand()); } else { @@ -712,7 +712,7 @@ class CommandCSLevels : public Command CommandInfo *help = source.service->FindCommand("generic/help"); if (help) source.Reply(_("There is no such privilege \002{0}\002. See \002{0}{1} {2} {3}\002 for a list of valid settings."), - what, Config->StrictPrivmsg, source.service->nick, help->cname, source.command); + what, Config->StrictPrivmsg, source.service->nick, help->cname, source.GetCommand()); } void DoList(CommandSource &source, ChanServ::Channel *ci) @@ -878,7 +878,7 @@ class CommandCSLevels : public Command "\002{0} RESET\002 resets the levels to the default levels for newly registered channels.\n" "\n" "For the list of privileges and their descriptions, see \002{3} {4} DESC\002."), - source.command, name, "FOUNDER", help->cname, source.command); + source.GetCommand(), name, "FOUNDER", help->cname, source.GetCommand()); } return true; } diff --git a/modules/chanserv/akick.cpp b/modules/chanserv/akick.cpp index 35bca6818..60d6530e4 100644 --- a/modules/chanserv/akick.cpp +++ b/modules/chanserv/akick.cpp @@ -620,7 +620,7 @@ class CommandCSAKick : public Command "\n" " {command} #anope ADD Guest*!*@*\n" " Adds the mask \"Guest*!*@*\" to the auto kick list of \"#anope\"."), - source.command); + source.GetCommand()); else if (subcommand.equals_ci("DEL")) source.Reply(_("The \002{0} DEL\002 command removes \037mask\037 from the auto kick list." " It does not, however, remove any bans placed by an auto kick; those must be removed manually.\n" @@ -628,7 +628,7 @@ class CommandCSAKick : public Command "Example:\n" " {command} #anope DEL Cronus!\n" " Removes the auto kick for \"Cronus\" from the auto kick list of \"#anope\".\n"), - 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 command displays the auto kick list of \037channel\037." " If a wildcard mask is given, only those entries matching the mask are displayed." @@ -638,7 +638,7 @@ class CommandCSAKick : public Command "Example:\n" " \002{0} #anope LIST 2-5,7-9\002\n" " Lists auto kick entries numbered 2 through 5 and 7 through 9 on #anope."), - source.command); + source.GetCommand()); else if (subcommand.equals_ci("ENFORCE")) source.Reply(_("The \002{0} ENFORCE\002 command enforces the auto kick list by forcibly removing users who match an entry on the auto kick list." "This can be useful if someone does not authenticate or change their host mask until after joining.\n" @@ -646,14 +646,14 @@ class CommandCSAKick : public Command "Example:\n" " \002{0} #anope ENFORCE\002\n" " Enforces the auto kick list of #anope."), - source.command); + source.GetCommand()); else if (subcommand.equals_ci("CLEAR")) source.Reply(_("The \002{0} CLEAR\002 command clears the auto kick list of \037channel\37. As with the \002DEL\002 command, existing bans placed by auto kick will not be removed.\n" "\n" "Example:\n" " \002{0} #anope CLEAR\002\n" " Clears the auto kick list of #anope."), - source.command); + source.GetCommand()); else { source.Reply(_("Maintains the auto kick list for \037channel\037." @@ -678,7 +678,7 @@ class CommandCSAKick : public Command "" "The \002CLEAR\002 clears the auto kick list of \037channel\037." "\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/chanserv/entrymsg.cpp b/modules/chanserv/entrymsg.cpp index b2edbc56f..8867fe6ab 100644 --- a/modules/chanserv/entrymsg.cpp +++ b/modules/chanserv/entrymsg.cpp @@ -264,7 +264,7 @@ class CommandEntryMessage : public Command "The \002{0} CLEAR\002 command clears the entry message list.\n" "\n" "Use of this command requires the \002SET\002 privilege on \037channel\037."), - source.command); + source.GetCommand()); return true; } }; diff --git a/modules/chanserv/flags.cpp b/modules/chanserv/flags.cpp index d87863be0..d30d02b4a 100644 --- a/modules/chanserv/flags.cpp +++ b/modules/chanserv/flags.cpp @@ -471,7 +471,7 @@ class CommandCSFlags : public Command " If the mask has no more flags, then the mask is removed from the access list." " Additionally, you may use +* or -* to add or remove all flags, respectively." " You are only able to modify the access list if you have the \002{1}\002 privilege on the channel, and can only give privileges to up what you have."), - source.command, "ACCESS_CHANGE"); + source.GetCommand(), "ACCESS_CHANGE"); source.Reply(" "); source.Reply(_("The \002LIST\002 command allows you to list existing entries on the channel access list." " If \037mask\037 is given, the \037mask\037 is wildcard matched against all existing entries on the access list, and only those entries are returned." diff --git a/modules/chanserv/list.cpp b/modules/chanserv/list.cpp index cd855a0b3..4c6712b67 100644 --- a/modules/chanserv/list.cpp +++ b/modules/chanserv/list.cpp @@ -207,7 +207,7 @@ class CommandCSSetPrivate : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; diff --git a/modules/chanserv/log.cpp b/modules/chanserv/log.cpp index 52724a57b..7e7fb084a 100644 --- a/modules/chanserv/log.cpp +++ b/modules/chanserv/log.cpp @@ -350,7 +350,7 @@ public: "Example:\n" " {command} #anope chanserv/access MESSAGE @\n" " Would message any channel operators of \"#anope\" whenever someone used the \"ACCESS\" command on ChanServ for \"#anope\"."), - source.command, "SET"); + source.GetCommand(), "SET"); return true; } }; diff --git a/modules/chanserv/main/chanserv.cpp b/modules/chanserv/main/chanserv.cpp index 62d1e81ba..dd6bdb472 100644 --- a/modules/chanserv/main/chanserv.cpp +++ b/modules/chanserv/main/chanserv.cpp @@ -346,14 +346,14 @@ class ChanServCore : public Module { if (!params.empty() || source.c || source.service != *ChanServ) return EVENT_CONTINUE; - source.Reply(_("\002%s\002 allows you to register and control various\n" - "aspects of channels. %s can often prevent\n" + source.Reply(_("\002{0}\002 allows you to register and control various\n" + "aspects of channels. {1} can often prevent\n" "malicious users from \"taking over\" channels by limiting\n" "who is allowed channel operator privileges. Available\n" "commands are listed below; to use them, type\n" - "\002%s%s \037command\037\002. For more information on a\n" - "specific command, type \002%s%s HELP \037command\037\002.\n"), - ChanServ->nick.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str(), Config->StrictPrivmsg.c_str(), ChanServ->nick.c_str(), ChanServ->nick.c_str(), source.command.c_str()); + "\002{2}{3} \037command\037\002. For more information on a\n" + "specific command, type \002{4}{5} HELP \037command\037\002.\n"), + ChanServ->nick, ChanServ->nick, Config->StrictPrivmsg, ChanServ->nick, Config->StrictPrivmsg, ChanServ->nick, ChanServ->nick, source.GetCommand()); return EVENT_CONTINUE; } diff --git a/modules/chanserv/mode.cpp b/modules/chanserv/mode.cpp index e76469823..c828e19ae 100644 --- a/modules/chanserv/mode.cpp +++ b/modules/chanserv/mode.cpp @@ -767,7 +767,7 @@ class CommandCSMode : public Command "\n" "The \002{0} CLEAR\002 command is an easy way to clear modes on a channel. \037what\037 may be any mode name. Examples include bans, excepts, inviteoverrides, ops, halfops, and voices." " If \037what\037 is not given then all basic modes are removed."), - source.command.upper()); + source.GetCommand().upper()); return true; } }; @@ -808,7 +808,7 @@ class CommandCSModes : public Command } ChanServ::AccessGroup u_access = source.AccessFor(ci), targ_access = ci->AccessFor(targ); - const std::pair<bool, Anope::string> &m = modes[source.command]; + const std::pair<bool, Anope::string> &m = modes[source.GetCommand()]; bool can_override = source.HasPriv("chanserv/administration"); bool override = false; @@ -859,7 +859,7 @@ class CommandCSModes : public Command const Anope::string GetDesc(CommandSource &source) const override { - const std::pair<bool, Anope::string> &m = modes[source.command]; + const std::pair<bool, Anope::string> &m = modes[source.GetCommand()]; if (!m.second.empty()) { if (m.first) @@ -875,7 +875,7 @@ class CommandCSModes : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { - const std::pair<bool, Anope::string> &m = modes[source.command]; + const std::pair<bool, Anope::string> &m = modes[source.GetCommand()]; if (m.second.empty()) return false; diff --git a/modules/chanserv/set.cpp b/modules/chanserv/set.cpp index 7b6775c2f..1584052f3 100644 --- a/modules/chanserv/set.cpp +++ b/modules/chanserv/set.cpp @@ -46,7 +46,7 @@ class CommandCSSet : public Command source.Reply(_("Allows the channel founder to set various channel options and other information.\n" "\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) @@ -65,7 +65,7 @@ class CommandCSSet : public Command else if (hide_privileged_commands && !info.permission.empty() && !source.HasCommand(info.permission)) continue; - source.command = it->first; + source.SetCommand(it->first); c->OnServHelp(source); } } @@ -109,7 +109,7 @@ class CommandCSSetAutoOp : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -173,7 +173,7 @@ class CommandCSSetBanType : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -242,7 +242,7 @@ class CommandCSSetDescription : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -302,7 +302,7 @@ class CommandCSSetFounder : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName()); return; @@ -372,7 +372,7 @@ class CommandCSSetKeepModes : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -447,7 +447,7 @@ class CommandCSSetPeace : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -523,7 +523,7 @@ class CommandCSSetPersist : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -669,7 +669,7 @@ class CommandCSSetRestricted : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -734,7 +734,7 @@ class CommandCSSetSecure : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -801,7 +801,7 @@ class CommandCSSetSecureFounder : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName()); return; @@ -871,7 +871,7 @@ class CommandCSSetSecureOps : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -937,7 +937,7 @@ class CommandCSSetSignKick : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -1015,7 +1015,7 @@ class CommandCSSetSuccessor : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && (ci->IsSecureFounder() ? !source.IsFounder(ci) : !source.AccessFor(ci).HasPriv("FOUNDER")) && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName()); return; @@ -1089,7 +1089,7 @@ class CommandCSSetNoexpire : public Command return; } - if (source.permission.empty() && !source.AccessFor(ci).HasPriv("SET")) + if (source.GetPermission().empty() && !source.AccessFor(ci).HasPriv("SET")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; diff --git a/modules/chanserv/set_misc.cpp b/modules/chanserv/set_misc.cpp index 76f4c7017..144010d2b 100644 --- a/modules/chanserv/set_misc.cpp +++ b/modules/chanserv/set_misc.cpp @@ -128,13 +128,13 @@ class CommandCSSetMisc : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; } - Anope::string scommand = GetAttribute(source.command); + Anope::string scommand = GetAttribute(source.GetCommand()); /* remove existing */ for (CSMiscData *data : ci->GetRefs<CSMiscData *>()) @@ -167,18 +167,18 @@ class CommandCSSetMisc : 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("%s", Language::Translate(source.nc, descriptions[source.command].c_str())); + source.Reply(Language::Translate(source.nc, descriptions[source.GetCommand()])); return true; } return false; diff --git a/modules/chanserv/topic.cpp b/modules/chanserv/topic.cpp index 648c322fb..3b4251b58 100644 --- a/modules/chanserv/topic.cpp +++ b/modules/chanserv/topic.cpp @@ -54,7 +54,7 @@ class CommandCSSetKeepTopic : public Command if (MOD_RESULT == EVENT_STOP) return; - if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.permission.empty() && !source.HasPriv("chanserv/administration")) + if (MOD_RESULT != EVENT_ALLOW && !source.AccessFor(ci).HasPriv("SET") && source.GetPermission().empty() && !source.HasPriv("chanserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; diff --git a/modules/chanserv/xop.cpp b/modules/chanserv/xop.cpp index b95580a2b..4dd5f8b3e 100644 --- a/modules/chanserv/xop.cpp +++ b/modules/chanserv/xop.cpp @@ -134,7 +134,7 @@ class CommandCSXOP : public Command if (Anope::ReadOnly) { - source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.command); + source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.GetCommand()); return; } @@ -142,7 +142,7 @@ class CommandCSXOP : public Command ChanServ::ChanAccess *highest = access.Highest(); bool override = false; - std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()), + std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.GetCommand().upper()), access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccessImpl::DetermineLevel(highest)) : order.end(); if (!access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it)) @@ -240,14 +240,14 @@ class CommandCSXOP : public Command acc->SetChannel(ci); acc->SetMask(mask); acc->SetCreator(source.GetNick()); - acc->SetType(source.command.upper()); + acc->SetType(source.GetCommand().upper()); acc->SetLastSeen(0); acc->SetCreated(Anope::CurTime); logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to add {0}"), mask); EventManager::Get()->Dispatch(&Event::AccessAdd::OnAccessAdd, ci, source, acc); - source.Reply(_("\002{0}\002 added to {1} {2} list."), acc->Mask(), ci->GetName(), source.command); + source.Reply(_("\002{0}\002 added to {1} {2} list."), acc->Mask(), ci->GetName(), source.GetCommand()); } void DoDel(CommandSource &source, ChanServ::Channel *ci, const std::vector<Anope::string> ¶ms) @@ -263,13 +263,13 @@ class CommandCSXOP : public Command if (Anope::ReadOnly) { - source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.command); + source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.GetCommand()); return; } if (!ci->GetAccessCount()) { - source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.command); + source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.GetCommand()); return; } @@ -289,7 +289,7 @@ class CommandCSXOP : public Command } } - std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.command.upper()), + std::vector<Anope::string>::iterator cmd_it = std::find(order.begin(), order.end(), source.GetCommand().upper()), access_it = highest ? std::find(order.begin(), order.end(), XOPChanAccessImpl::DetermineLevel(highest)) : order.end(); if (!mask.equals_ci(nc->GetDisplay()) && !access.founder && (!access.HasPriv("ACCESS_CHANGE") || cmd_it <= access_it)) @@ -317,7 +317,7 @@ class CommandCSXOP : public Command ChanServ::ChanAccess *caccess = ci->GetAccess(number - 1); - if (caccess->GetSerializableType()->GetName() != "XOPChanAccess" || source.command.upper() != caccess->AccessSerialize()) + if (caccess->GetSerializableType()->GetName() != "XOPChanAccess" || source.GetCommand().upper() != caccess->AccessSerialize()) return; ++deleted; @@ -332,15 +332,15 @@ class CommandCSXOP : public Command [&]() { if (!deleted) - source.Reply(_("No matching entries on {0} {1} list."), ci->GetName(), source.command); + source.Reply(_("No matching entries on {0} {1} list."), ci->GetName(), source.GetCommand()); else { logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to delete {0}"), nicks); if (deleted == 1) - source.Reply(_("Deleted one entry from {0} {1} list."), ci->GetName(), source.command); + source.Reply(_("Deleted one entry from {0} {1} list."), ci->GetName(), source.GetCommand()); else - source.Reply(_("Deleted {0} entries from {1} {2} list."), deleted, ci->GetName(), source.command); + source.Reply(_("Deleted {0} entries from {1} {2} list."), deleted, ci->GetName(), source.GetCommand()); } }); } @@ -350,14 +350,14 @@ class CommandCSXOP : public Command { ChanServ::ChanAccess *a = ci->GetAccess(i); - if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.command.upper() != a->AccessSerialize()) + if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.GetCommand().upper() != a->AccessSerialize()) continue; if (a->Mask().equals_ci(mask)) { logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to delete {0}"), a->GetMask()); - source.Reply(_("\002{0}\002 deleted from {1} {2} list."), a->Mask(), ci->GetName(), source.command); + source.Reply(_("\002{0}\002 deleted from {1} {2} list."), a->Mask(), ci->GetName(), source.GetCommand()); EventManager::Get()->Dispatch(&Event::AccessDel::OnAccessDel, ci, source, a); a->Delete(); @@ -366,7 +366,7 @@ class CommandCSXOP : public Command } } - source.Reply(_("\002{0}\002 not found on {1} {2} list."), mask, ci->GetName(), source.command); + source.Reply(_("\002{0}\002 not found on {1} {2} list."), mask, ci->GetName(), source.GetCommand()); } } @@ -385,7 +385,7 @@ class CommandCSXOP : public Command if (!ci->GetAccessCount()) { - source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.command); + source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.GetCommand()); return; } @@ -402,7 +402,7 @@ class CommandCSXOP : public Command ChanServ::ChanAccess *a = ci->GetAccess(number - 1); - if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.command.upper() != a->AccessSerialize()) + if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.GetCommand().upper() != a->AccessSerialize()) return; ListFormatter::ListEntry entry; @@ -418,7 +418,7 @@ class CommandCSXOP : public Command { ChanServ::ChanAccess *a = ci->GetAccess(i); - if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.command.upper() != a->AccessSerialize()) + if (a->GetSerializableType()->GetName() != "XOPChanAccess" || source.GetCommand().upper() != a->AccessSerialize()) continue; if (!nick.empty() && !Anope::Match(a->Mask(), nick)) continue; @@ -439,7 +439,7 @@ class CommandCSXOP : public Command std::vector<Anope::string> replies; list.Process(replies); - source.Reply(_("{0} list for {1}"), source.command, ci->GetName()); + source.Reply(_("{0} list for {1}"), source.GetCommand(), ci->GetName()); for (unsigned i = 0; i < replies.size(); ++i) source.Reply(replies[i]); } @@ -449,13 +449,13 @@ class CommandCSXOP : public Command { if (Anope::ReadOnly) { - source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.command); + source.Reply(_("Sorry, channel {0} list modification is temporarily disabled."), source.GetCommand()); return; } if (!ci->GetAccessCount()) { - source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.command); + source.Reply(_("{0} {1} list is empty."), ci->GetName(), source.GetCommand()); return; } @@ -472,7 +472,7 @@ class CommandCSXOP : public Command { ChanServ::ChanAccess *access = ci->GetAccess(i - 1); - if (access->GetSerializableType()->GetName() != "XOPChanAccess" || source.command.upper() != access->AccessSerialize()) + if (access->GetSerializableType()->GetName() != "XOPChanAccess" || source.GetCommand().upper() != access->AccessSerialize()) continue; access->Delete(); @@ -480,7 +480,7 @@ class CommandCSXOP : public Command EventManager::Get()->Dispatch(&Event::AccessClear::OnAccessClear, ci, source); - source.Reply(_("Channel {0} {1} list has been cleared."), ci->GetName(), source.command); + source.Reply(_("Channel {0} {1} list has been cleared."), ci->GetName(), source.GetCommand()); } public: @@ -494,7 +494,7 @@ class CommandCSXOP : public Command const Anope::string GetDesc(CommandSource &source) const override { - return Anope::Format(Language::Translate(source.GetAccount(), _("Modify the list of {0} users")), source.command.upper()); + return Anope::Format(Language::Translate(source.GetAccount(), _("Modify the list of {0} users")), source.GetCommand().upper()); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -527,13 +527,13 @@ class CommandCSXOP : public Command { source.Reply(_("The \002{0} ADD\002 command adds \037mask\037 to the {0} list of \037channel\037." " If you have the privilege to use this command, you may use it if you have more privileges than it grants."), - source.command); + source.GetCommand()); source.Reply(_("Use of this command requires the \002{0}\002 privilege on \037channel\037.\n" "Example:\n" " {1} #anope ADD Adam" " Adds \"Adam\" to the access list of \"#anope\" with the privilege set {1}"), - "ACCESS_CHANGE", source.command); + "ACCESS_CHANGE", source.GetCommand()); } else if (subcommand.equals_ci("DEL")) source.Reply(_("The \002{0} DEL\002 command removes the given \037mask\037 from the {0} list of \037channel\037." @@ -543,7 +543,7 @@ class CommandCSXOP : public Command "Example:\n" " {0} #anope DEL Cronus" " Removes \"Cronus\" from the {0} list of \"#anope\""), - source.command, "ACCESS_CHANGE"); + source.GetCommand(), "ACCESS_CHANGE"); else if (subcommand.equals_ci("LIST")) source.Reply(_("The \002{0} LIST\002 command displays the {0} list of \037channel\037." " If a wildcard mask is given, only those entries matching the mask are displayed." @@ -554,23 +554,23 @@ class CommandCSXOP : public Command "Example:" " {0} #anope LIST 2-5,7-9\n" " List entries numbered 2 |
