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/greet.cpp | |
parent | 9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff) |
Track override in CommandSource and use it in the logger
Diffstat (limited to 'modules/greet.cpp')
-rw-r--r-- | modules/greet.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/greet.cpp b/modules/greet.cpp index a954a7f21..cf3dba3bc 100644 --- a/modules/greet.cpp +++ b/modules/greet.cpp @@ -49,7 +49,7 @@ class CommandBSSetGreet : public Command return; } - if (!source.HasPriv("botserv/administration") && !source.AccessFor(ci).HasPriv("SET")) + 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()); return; @@ -57,16 +57,14 @@ class CommandBSSetGreet : public Command if (value.equals_ci("ON")) { - bool override = !source.AccessFor(ci).HasPriv("SET"); - logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to enable greets")); + logger.Command(source, ci, _("{source} used {command} on {channel} to enable greets")); ci->SetGreet(true); source.Reply(_("Greet mode for \002{0}\002 is now \002on\002."), ci->GetName()); } else if (value.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 greets")); + logger.Command(source, ci, _("{source} used {command} on {channel} to disable greets")); ci->SetGreet(false); source.Reply(_("Greet mode for \002{0}\002 is now \002off\002."), ci->GetName()); |