summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-02-06 14:23:18 -0500
committerAdam <Adam@anope.org>2017-02-06 14:23:18 -0500
commit8b694bc392c36551e428b84454efb81cdbc8bcd3 (patch)
treeca3d1ca8aadac280c149518134de4208f91dad84 /src
parent9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff)
Track override in CommandSource and use it in the logger
Diffstat (limited to 'src')
-rw-r--r--src/command.cpp27
-rw-r--r--src/logger.cpp6
2 files changed, 29 insertions, 4 deletions
diff --git a/src/command.cpp b/src/command.cpp
index e7fc61457..02decd1b7 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -152,6 +152,29 @@ bool CommandSource::IsOper()
return false;
}
+bool CommandSource::HasOverridePriv(const Anope::string &priv)
+{
+ if (!HasPriv(priv))
+ return false;
+
+ override = true;
+ return true;
+}
+
+bool CommandSource::HasOverrideCommand(const Anope::string &priv)
+{
+ if (!HasCommand(priv))
+ return false;
+
+ override = true;
+ return true;
+}
+
+bool CommandSource::IsOverride() const
+{
+ return override;
+}
+
void CommandSource::Reply(const Anope::string &message)
{
const char *translated_message = Language::Translate(this->nc, message.c_str());
@@ -170,10 +193,6 @@ Command::Command(Module *o, const Anope::string &sname, size_t minparams, size_t
{
}
-Command::~Command()
-{
-}
-
void Command::SetDesc(const Anope::string &d)
{
this->desc = d;
diff --git a/src/logger.cpp b/src/logger.cpp
index f6e961ee8..d686391d9 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -298,6 +298,12 @@ void Logger::InsertVariables(FormatInfo &fi)
fi.Add("command"_kw = command->GetName());
}
+void Logger::CheckOverride()
+{
+ if (type == LogType::COMMAND && source != nullptr && source->IsOverride())
+ type = LogType::OVERRIDE;
+}
+
Anope::string Logger::FormatSource() const
{
if (user)