summaryrefslogtreecommitdiff
path: root/modules/commands/bs_control.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-03-13 09:44:43 -0500
committerAdam <Adam@anope.org>2013-03-13 09:45:15 -0500
commit1d16629a6da2f1d5b65557028e75abc7de51cad5 (patch)
treed356ef0186eee4bf54f849bca09f4b98071d6266 /modules/commands/bs_control.cpp
parent72aa27ede5f265fe976f8e9935239aed9930ff3a (diff)
Allow opers to override chanserv kick/ban, botserv say/act, and akick's peace setting
Diffstat (limited to 'modules/commands/bs_control.cpp')
-rw-r--r--modules/commands/bs_control.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/modules/commands/bs_control.cpp b/modules/commands/bs_control.cpp
index 37dc2c489..d78ca6851 100644
--- a/modules/commands/bs_control.cpp
+++ b/modules/commands/bs_control.cpp
@@ -33,7 +33,7 @@ class CommandBSSay : public Command
return;
}
- if (!source.AccessFor(ci).HasPriv("SAY"))
+ if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -60,10 +60,8 @@ class CommandBSSay : public Command
IRCD->SendPrivmsg(ci->bi, ci->name, "%s", text.c_str());
ci->bi->lastmsg = Anope::CurTime;
- // XXX need a way to find if someone is overriding this
- Log(LOG_COMMAND, source, this, ci) << text;
-
- return;
+ bool override = !source.AccessFor(ci).HasPriv("SAY");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << text;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
@@ -95,7 +93,7 @@ class CommandBSAct : public Command
return;
}
- if (!source.AccessFor(ci).HasPriv("SAY"))
+ if (!source.AccessFor(ci).HasPriv("SAY") && !source.HasPriv("botserv/administration"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -113,17 +111,15 @@ class CommandBSAct : public Command
return;
}
- size_t i = 0;
- while ((i = message.find(1)) && i != Anope::string::npos)
- message.erase(i, 1);
+ message = message.replace_all_cs("\1", "");
+ if (message.empty())
+ return;
IRCD->SendAction(ci->bi, ci->name, "%s", message.c_str());
ci->bi->lastmsg = Anope::CurTime;
- // XXX Need to be able to find if someone is overriding this.
- Log(LOG_COMMAND, source, this, ci) << message;
-
- return;
+ bool override = !source.AccessFor(ci).HasPriv("SAY");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to say: " << message;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override