diff options
Diffstat (limited to 'modules/botserv')
| -rw-r--r-- | modules/botserv/assign.cpp | 14 | ||||
| -rw-r--r-- | modules/botserv/badwords.cpp | 15 | ||||
| -rw-r--r-- | modules/botserv/bot.cpp | 6 | ||||
| -rw-r--r-- | modules/botserv/control.cpp | 10 | ||||
| -rw-r--r-- | modules/botserv/kick.cpp | 28 | ||||
| -rw-r--r-- | modules/botserv/set.cpp | 5 |
6 files changed, 32 insertions, 46 deletions
diff --git a/modules/botserv/assign.cpp b/modules/botserv/assign.cpp index bb2d35879..b743564b0 100644 --- a/modules/botserv/assign.cpp +++ b/modules/botserv/assign.cpp @@ -55,7 +55,7 @@ class CommandBSAssign : public Command } ChanServ::AccessGroup access = source.AccessFor(ci); - if (!access.HasPriv("ASSIGN") && !source.HasPriv("botserv/administration")) + if (!access.HasPriv("ASSIGN") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "ASSIGN", ci->GetName()); return; @@ -79,8 +79,7 @@ class CommandBSAssign : public Command return; } - bool override = !access.HasPriv("ASSIGN"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to assign {0}"), bi->nick); + logger.Command(source, ci, _("{source} used {command} on {channel} to assign {0}"), bi->nick); bi->Assign(source.GetUser(), ci); source.Reply(_("Bot \002{0}\002 has been assigned to \002{1}\002."), bi->nick, ci->GetName()); @@ -128,7 +127,7 @@ class CommandBSUnassign : public Command } ChanServ::AccessGroup access = source.AccessFor(ci); - if (!source.HasPriv("botserv/administration") && !access.HasPriv("ASSIGN")) + if (!access.HasPriv("ASSIGN") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "ASSIGN", ci->GetName()); return; @@ -146,8 +145,7 @@ class CommandBSUnassign : public Command return; } - bool override = !access.HasPriv("ASSIGN"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to unassign {0}"), ci->GetBot()->nick); + logger.Command(source, ci, _("{source} used {command} on {channel} to unassign {0}"), ci->GetBot()->nick); ServiceBot *bi = ci->GetBot(); bi->UnAssign(source.GetUser(), ci); @@ -192,7 +190,7 @@ class CommandBSSetNoBot : public Command if (value.equals_ci("ON")) { - logger.Command(LogType::ADMIN, source, ci, _("{source} used {command} on {channel} to enable nobot")); + logger.Admin(source, ci, _("{source} used {command} on {channel} to enable nobot")); ci->SetS<bool>("BS_NOBOT", true); if (ci->GetBot()) @@ -201,7 +199,7 @@ class CommandBSSetNoBot : public Command } else if (value.equals_ci("OFF")) { - logger.Command(LogType::ADMIN, source, ci, _("{source} used {command} on {channel} to disable nobot")); + logger.Admin(source, ci, _("{source} used {command} on {channel} to disable nobot")); ci->UnsetS<bool>("BS_NOBOT"); source.Reply(_("No-bot mode is now \002off\002 for \002{0}\002."), ci->GetName()); diff --git a/modules/botserv/badwords.cpp b/modules/botserv/badwords.cpp index 3de381d34..5fb7fa342 100644 --- a/modules/botserv/badwords.cpp +++ b/modules/botserv/badwords.cpp @@ -143,8 +143,7 @@ class CommandBSBadwords : public Command void DoList(CommandSource &source, ChanServ::Channel *ci, const Anope::string &word) { - bool override = !source.AccessFor(ci).HasPriv("BADWORDS"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to list badwords")); + logger.Command(source, ci, _("{source} used {command} on {channel} to list badwords")); ListFormatter list(source.GetAccount()); list.AddColumn(_("Number")).AddColumn(_("Word")).AddColumn(_("Type")); @@ -243,8 +242,7 @@ class CommandBSBadwords : public Command return; } - bool override = !source.AccessFor(ci).HasPriv("BADWORDS"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to add {0}"), realword); + logger.Command(source, ci, _("{source} used {command} on {channel} to add {0}"), realword); badwords->AddBadWord(ci, realword, bwtype); source.Reply(_("\002{0}\002 added to \002{1}\002 bad words list."), realword, ci->GetName()); @@ -271,7 +269,7 @@ class CommandBSBadwords : public Command if (!num || num > badwords->GetBadWordCount(ci)) return; - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to remove {0}"), badwords->GetBadWord(ci, num - 1)->GetWord()); + logger.Command(source, ci, _("{source} used {command} on {channel} to remove {0}"), badwords->GetBadWord(ci, num - 1)->GetWord()); ++deleted; badwords->EraseBadWord(ci, num - 1); @@ -305,7 +303,7 @@ class CommandBSBadwords : public Command return; } - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to remove {3}"), bw->GetWord()); + logger.Command(source, ci, _("{source} used {command} on {channel} to remove {3}"), bw->GetWord()); source.Reply(_("\002{0}\002 deleted from \002{1}\002 bad words list."), bw->GetWord(), ci->GetName()); @@ -315,8 +313,7 @@ class CommandBSBadwords : public Command void DoClear(CommandSource &source, ChanServ::Channel *ci) { - bool override = !source.AccessFor(ci).HasPriv("BADWORDS"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to clear the badwords list")); + logger.Command(source, ci, _("{source} used {command} on {channel} to clear the badwords list")); badwords->ClearBadWords(ci); source.Reply(_("Bad words list is now empty.")); @@ -352,7 +349,7 @@ class CommandBSBadwords : public Command return; } - if (!source.AccessFor(ci).HasPriv("BADWORDS") && (!need_args || !source.HasPriv("botserv/administration"))) + if (!source.AccessFor(ci).HasPriv("BADWORDS") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "BADWORDS", ci->GetName()); return; diff --git a/modules/botserv/bot.cpp b/modules/botserv/bot.cpp index ab48dc82e..2e632a805 100644 --- a/modules/botserv/bot.cpp +++ b/modules/botserv/bot.cpp @@ -103,7 +103,7 @@ class CommandBSBot : public Command bi->bi = botinfo; botinfo->bot = bi; - logger.Command(LogType::ADMIN, source, _("{source} used {command} to add bot {0} {1}"), bi->GetMask(), bi->realname); + logger.Admin(source, _("{source} used {command} to add bot {0} {1}"), bi->GetMask(), bi->realname); source.Reply(_("\002{0}!{1}@{2}\002 (\002{3}\002) added to the bot list."), bi->nick, bi->GetIdent(), bi->host, bi->realname); @@ -266,7 +266,7 @@ class CommandBSBot : public Command if (!user.empty()) bi->OnKill(); - logger.Command(LogType::ADMIN, source, _("{source} used {command} to change bot {0} to {1} {2}"), + logger.Admin(source, _("{source} used {command} to change bot {0} to {1} {2}"), oldnick, bi->GetMask(), bi->realname); source.Reply(_("Bot \002{0}\002 has been changed to \002{1}!{2}@{3}\002 (\002{4}\002)."), oldnick, bi->nick, bi->GetIdent(), bi->host, bi->realname); @@ -299,7 +299,7 @@ class CommandBSBot : public Command EventManager::Get()->Dispatch(&Event::BotDelete::OnBotDelete, bi); - logger.Command(LogType::ADMIN, source, _("{source} used {command} to delete bot {0}"), bi->nick); + logger.Admin(source, _("{source} used {command} to delete bot {0}"), bi->nick); source.Reply(_("Bot \002{0}\002 has been deleted."), bi->nick); delete bi; diff --git a/modules/botserv/control.cpp b/modules/botserv/control.cpp index 6a8edc200..ce2b0d6e6 100644 --- a/modules/botserv/control.cpp +++ b/modules/botserv/control.cpp @@ -40,7 +40,7 @@ class CommandBSSay : public Command return; } - if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) + if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName()); return; @@ -74,8 +74,7 @@ class CommandBSSay : public Command IRCD->SendPrivmsg(ci->GetBot(), ci->GetName(), text); ci->GetBot()->lastmsg = Anope::CurTime; - bool override = !source.AccessFor(ci).HasPriv("SAY"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to say: {0}"), text); + logger.Command(source, ci, _("{source} used {command} on {channel} to say: {0}"), text); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override @@ -112,7 +111,7 @@ class CommandBSAct : public Command return; } - if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration")) + if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SAY", ci->GetName()); return; @@ -144,8 +143,7 @@ class CommandBSAct : public Command IRCD->SendAction(ci->GetBot(), ci->GetName(), message); ci->GetBot()->lastmsg = Anope::CurTime; - bool override = !source.AccessFor(ci).HasPriv("SAY"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} to say: {0}"), message); + logger.Command(source, ci, _("{source} used {command} to say: {0}"), message); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override diff --git a/modules/botserv/kick.cpp b/modules/botserv/kick.cpp index 84939c963..3146483e9 100644 --- a/modules/botserv/kick.cpp +++ b/modules/botserv/kick.cpp @@ -586,7 +586,7 @@ class CommandBSKickBase : public Command this->OnSyntaxError(source, ""); else if (!option.equals_ci("ON") && !option.equals_ci("OFF")) this->OnSyntaxError(source, ""); - else if (!source.AccessFor(ci).HasPriv("SET") && !source.HasPriv("botserv/administration")) + else if (!source.AccessFor(ci).HasPriv("SET") && !source.HasOverridePriv("botserv/administration")) source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); else if (!ci->GetBot()) source.Reply(_("There is no bot assigned to \002{0}\002."), ci->GetName()); @@ -636,13 +636,11 @@ class CommandBSKickBase : public Command else source.Reply(_("Bot will now kick for \002{0}\002."), optname); - bool override = !source.AccessFor(ci).HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to enable the {0} kicker"), optname); + logger.Command(source, ci, _("{source} used {command} on {channel} to enable the {0} kicker"), optname); } else if (param.equals_ci("OFF")) { - bool override = !source.AccessFor(ci).HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to disable the {0} kicker"), optname); + logger.Command(source, ci, _("{source} used {command} on {channel} to disable the {0} kicker"), optname); (kd->*setter)(false); (kd->*ttbsetter)(0); @@ -1082,7 +1080,7 @@ class CommandBSSetDontKickOps : public Command } ChanServ::AccessGroup access = source.AccessFor(ci); - if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET")) + if (!access.HasPriv("SET") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -1098,16 +1096,14 @@ class CommandBSSetDontKickOps : public Command if (params[1].equals_ci("ON")) { - bool override = !access.HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to enable dontkickops")); + logger.Command(source, ci, _("{source} used {command} on {channel} to enable dontkickops")); kd->SetDontKickOps(true); source.Reply(_("Bot \002won't kick ops\002 on channel \002{0}\002."), ci->GetName()); } else if (params[1].equals_ci("OFF")) { - bool override = !access.HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to disable dontkickops")); + logger.Command(source, ci, _("{source} used {command} on {channel} to disable dontkickops")); kd->SetDontKickOps(false); source.Reply(_("Bot \002will kick ops\002 on channel \002{0}\002."), ci->GetName()); @@ -1148,7 +1144,7 @@ class CommandBSSetDontKickVoices : public Command } ChanServ::AccessGroup access = source.AccessFor(ci); - if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET")) + if (!access.HasPriv("SET") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -1164,19 +1160,17 @@ class CommandBSSetDontKickVoices : public Command if (params[1].equals_ci("ON")) { - bool override = !access.HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to enable dontkickvoices")); + logger.Command(source, ci, _("{source} used {command} on {channel} to enable dontkickvoices")); kd->SetDontKickVoices(true); - source.Reply(_("Bot \002won't kick voices\002 on channel %s."), ci->GetName().c_str()); + source.Reply(_("Bot \002won't kick voices\002 on channel \002{0}\002."), ci->GetName()); } else if (params[1].equals_ci("OFF")) { - bool override = !access.HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to disable dontkickvoices")); + logger.Command(source, ci, _("{source} used {command} on {channel} to disable dontkickvoices")); kd->SetDontKickVoices(false); - source.Reply(_("Bot \002will kick voices\002 on channel %s."), ci->GetName().c_str()); + source.Reply(_("Bot \002will kick voices\002 on channel \002{0}\002."), ci->GetName()); } else { diff --git a/modules/botserv/set.cpp b/modules/botserv/set.cpp index da3b42f92..559453085 100644 --- a/modules/botserv/set.cpp +++ b/modules/botserv/set.cpp @@ -111,7 +111,7 @@ class CommandBSSetBanExpire : public Command } ChanServ::AccessGroup access = source.AccessFor(ci); - if (!source.HasPriv("botserv/administration") && !access.HasPriv("SET")) + if (!access.HasPriv("SET") && !source.HasOverridePriv("botserv/administration")) { source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "SET", ci->GetName()); return; @@ -139,8 +139,7 @@ class CommandBSSetBanExpire : public Command ci->SetBanExpire(t); - bool override = !access.HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to change banexpire to {0}"), arg); + logger.Command(source, ci, _("{source} used {command} on {channel} to change banexpire to {0}"), arg); if (!t) source.Reply(_("Bot bans will no longer automatically expire.")); |
