summaryrefslogtreecommitdiff
path: root/modules/commands/cs_akick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/cs_akick.cpp')
-rw-r--r--modules/commands/cs_akick.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp
index 17b95e176..a67a5b543 100644
--- a/modules/commands/cs_akick.cpp
+++ b/modules/commands/cs_akick.cpp
@@ -187,16 +187,14 @@ class CommandCSAKick : public Command
ChannelInfo *ci;
Command *c;
unsigned deleted;
+ AccessGroup ag;
public:
- AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0)
+ AkickDelCallback(CommandSource &_source, ChannelInfo *_ci, Command *_c, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), c(_c), deleted(0), ag(source.AccessFor(ci))
{
}
~AkickDelCallback()
{
- bool override = !source.AccessFor(ci).HasPriv("AKICK");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << deleted << (deleted == 1 ? " entry" : " entries");
-
if (!deleted)
source.Reply(_("No matching entries on %s autokick list."), ci->name.c_str());
else if (deleted == 1)
@@ -210,7 +208,12 @@ class CommandCSAKick : public Command
if (!number || number > ci->GetAkickCount())
return;
- FOREACH_MOD(OnAkickDel, (source, ci, ci->GetAkick(number - 1)));
+ const AutoKick *akick = ci->GetAkick(number - 1);
+
+ FOREACH_MOD(OnAkickDel, (source, ci, akick));
+
+ bool override = !ag.HasPriv("AKICK");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, c, ci) << "to delete " << (akick->nc ? akick->nc->display : akick->mask);
++deleted;
ci->EraseAkick(number - 1);