summaryrefslogtreecommitdiff
path: root/modules/chanserv/flags.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/flags.cpp
parent9ad06f49bbb3824139b0c0ee0a74898a18c8f735 (diff)
Track override in CommandSource and use it in the logger
Diffstat (limited to 'modules/chanserv/flags.cpp')
-rw-r--r--modules/chanserv/flags.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/modules/chanserv/flags.cpp b/modules/chanserv/flags.cpp
index d30d02b4a..6ec65d104 100644
--- a/modules/chanserv/flags.cpp
+++ b/modules/chanserv/flags.cpp
@@ -160,7 +160,6 @@ class CommandCSFlags : public Command
ChanServ::ChanAccess *current = NULL;
unsigned current_idx;
std::set<char> current_flags;
- bool override = false;
for (current_idx = ci->GetAccessCount(); current_idx > 0; --current_idx)
{
ChanServ::ChanAccess *access = ci->GetAccess(current_idx - 1);
@@ -172,9 +171,7 @@ class CommandCSFlags : public Command
// operator<= on the non-me entry!
if (*highest <= *access)
{
- if (source.HasPriv("chanserv/access/modify"))
- override = true;
- else
+ if (!source.HasOverridePriv("chanserv/access/modify"))
{
source.Reply(_("Access denied. You do not have enough privileges on \002{0}\002 to modify the access of \002{1}\002."), ci->GetName(), access->Mask());
return;
@@ -219,9 +216,7 @@ class CommandCSFlags : public Command
if (!u_access.HasPriv(it->first) && !u_access.founder)
{
- if (source.HasPriv("chanserv/access/modify"))
- override = true;
- else
+ if (!source.HasOverridePriv("chanserv/access/modify"))
continue;
}
@@ -245,9 +240,7 @@ class CommandCSFlags : public Command
continue;
else if (!u_access.HasPriv(it->first) && !u_access.founder)
{
- if (source.HasPriv("chanserv/access/modify"))
- override = true;
- else
+ if (!source.HasOverridePriv("chanserv/access/modify"))
{
source.Reply(_("You can not set the \002{0}\002 flag."), f);
break;
@@ -267,7 +260,7 @@ class CommandCSFlags : public Command
{
EventManager::Get()->Dispatch(&Event::AccessDel::OnAccessDel, ci, source, current);
- logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to delete {0}"), current->Mask());
+ logger.Command(source, ci, _("{source} used {command} on {channel} to delete {0}"), current->Mask());
source.Reply(_("\002{0}\002 removed from the access list of \002{1}\002."), current->Mask(), ci->GetName());
@@ -297,7 +290,7 @@ class CommandCSFlags : public Command
EventManager::Get()->Dispatch(&Event::AccessAdd::OnAccessAdd, ci, source, access);
- logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to modify flags of {0} to {1}"), access->Mask(), access->AccessSerialize());
+ logger.Command(source, ci, _("{source} used {command} on {channel} to modify flags of {0} to {1}"), access->Mask(), access->AccessSerialize());
if (p != NULL)
{
@@ -376,7 +369,7 @@ class CommandCSFlags : public Command
void DoClear(CommandSource &source, ChanServ::Channel *ci)
{
- if (!source.IsFounder(ci) && !source.HasPriv("chanserv/access/modify"))
+ if (!source.IsFounder(ci) && !source.HasOverridePriv("chanserv/access/modify"))
{
source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->GetName());
return;
@@ -388,8 +381,7 @@ class CommandCSFlags : public Command
source.Reply(_("The access list of \002{0}\002 has been cleared."), ci->GetName());
- bool override = !source.IsFounder(ci);
- logger.Command(override ? LogType::OVERRIDE : LogType::COMMAND, source, ci, _("{source} used {command} on {channel} to clear the access list"));
+ logger.Command(source, ci, _("{source} used {command} on {channel} to clear the access list"));
}
public: