From 97d7c21193c490f647ee059dd28d4a37a684cbb1 Mon Sep 17 00:00:00 2001 From: Robby- Date: Fri, 4 Oct 2013 05:45:28 +0200 Subject: Fix logging for log type 'other'. os_ignore: Log expired ignores to the normal log level. cs_drop: Allow Services Operators to actually drop channels in Read-Only mode. os_akill, os_sxline, cs_akick: Log deletions by number. --- modules/commands/cs_akick.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'modules/commands/cs_akick.cpp') 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); -- cgit