summaryrefslogtreecommitdiff
path: root/modules/chanserv/updown.cpp
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 /modules/chanserv/updown.cpp
parent9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff)
Track override in CommandSource and use it in the logger
Diffstat (limited to 'modules/chanserv/updown.cpp')
-rw-r--r--modules/chanserv/updown.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/modules/chanserv/updown.cpp b/modules/chanserv/updown.cpp
index d3ceb617a..398726569 100644
--- a/modules/chanserv/updown.cpp
+++ b/modules/chanserv/updown.cpp
@@ -92,7 +92,6 @@ class CommandCSUp : public Command
User *u = User::Find(nick, true);
User *srcu = source.GetUser();
Channel *c = ci->c;
- bool override = false;
if (u == NULL)
{
@@ -102,12 +101,6 @@ class CommandCSUp : public Command
if (srcu && !srcu->FindChannel(c))
{
- source.Reply(_("You must be in \002%s\002 to use this command."), c->name.c_str());
- return;
- }
-
- if (!u->FindChannel(c))
- {
source.Reply(_("You must be on channel \002{0}\002 to use this command."), c->name);
return;
}
@@ -122,9 +115,7 @@ class CommandCSUp : public Command
{
if (c->ci->AccessFor(u) >= c->ci->AccessFor(source.GetUser()))
{
- if (source.HasPriv("chanserv/administration"))
- override = true;
- else
+ if (!source.HasOverridePriv("chanserv/administration"))
{
source.Reply(_("Access denied. \002{0}\002 has more privileges than you on \002{1}\002."), u->nick, ci->GetName());
return;
@@ -132,7 +123,7 @@ class CommandCSUp : public Command
}
}
- logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to update the status modes of {0}"), u->nick);
+ logger.Command(source, ci, _("{source} used {command} on {channel} to update the status modes of {0}"), u->nick);
SetModes(u, c);
}
@@ -198,7 +189,6 @@ class CommandCSDown : public Command
Channel *c = ci->c;
User *srcu = source.GetUser();
- bool override = false;
if (u == NULL)
{
@@ -212,12 +202,6 @@ class CommandCSDown : public Command
return;
}
- if (srcu && !srcu->FindChannel(c))
- {
- source.Reply(_("You must be in \002%s\002 to use this command."), c->name.c_str());
- return;
- }
-
if (!u->FindChannel(c))
{
source.Reply(_("\002%s\002 is not on channel %s."), u->nick, c->name);
@@ -228,9 +212,7 @@ class CommandCSDown : public Command
{
if (c->ci->AccessFor(u) >= c->ci->AccessFor(source.GetUser()))
{
- if (source.HasPriv("chanserv/administration"))
- override = true;
- else
+ if (!source.HasPriv("chanserv/administration"))
{
source.Reply(_("Access denied. \002{0}\002 has more privileges than you on \002{1}\002."), u->nick, ci->GetName());
return;
@@ -238,7 +220,7 @@ class CommandCSDown : public Command
}
}
- logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to remove the status modes from {0}"), u->nick);
+ logger.Command(source, ci, _("{source} used {command} on {channel} to remove the status modes from {0}"), u->nick);
RemoveAll(u, c);
}