diff options
author | Adam <Adam@anope.org> | 2017-02-06 14:23:18 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-02-06 14:23:18 -0500 |
commit | 8b694bc392c36551e428b84454efb81cdbc8bcd3 (patch) | |
tree | ca3d1ca8aadac280c149518134de4208f91dad84 /modules/botserv/assign.cpp | |
parent | 9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff) |
Track override in CommandSource and use it in the logger
Diffstat (limited to 'modules/botserv/assign.cpp')
-rw-r--r-- | modules/botserv/assign.cpp | 14 |
1 files changed, 6 insertions, 8 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()); |