diff options
author | Romain Rivière <lecoyote@lecoyote.org> | 2017-12-18 19:46:14 +0100 |
---|---|---|
committer | Adam <Adam@sigterm.info> | 2019-03-30 22:17:00 -0400 |
commit | 5c8548040a6c1f0cb1922ebf5f32c23b56086c49 (patch) | |
tree | aa5a5181a60df8844f362d8bfb75ec1fe5f4797b /modules/commands/ms_del.cpp | |
parent | 6a42c1a4f360464b19b053c3bd307f31201d08b5 (diff) |
Log channel memo deletions
Diffstat (limited to 'modules/commands/ms_del.cpp')
-rw-r--r-- | modules/commands/ms_del.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp index a3534dc47..2c3880e49 100644 --- a/modules/commands/ms_del.cpp +++ b/modules/commands/ms_del.cpp @@ -14,10 +14,11 @@ class MemoDelCallback : public NumberList { CommandSource &source; + Command *cmd; ChannelInfo *ci; MemoInfo *mi; public: - MemoDelCallback(CommandSource &_source, ChannelInfo *_ci, MemoInfo *_mi, const Anope::string &list) : NumberList(list, true), source(_source), ci(_ci), mi(_mi) + MemoDelCallback(CommandSource &_source, Command *c, ChannelInfo *_ci, MemoInfo *_mi, const Anope::string &list) : NumberList(list, true), source(_source), cmd(c), ci(_ci), mi(_mi) { } @@ -30,6 +31,8 @@ class MemoDelCallback : public NumberList mi->Del(number - 1); source.Reply(_("Memo %d has been deleted."), number); + if (ci) + Log(LOG_COMMAND, source, cmd, ci) << "on memo " << number; } }; @@ -87,7 +90,7 @@ class CommandMSDel : public Command { if (isdigit(numstr[0])) { - MemoDelCallback list(source, ci, mi, numstr); + MemoDelCallback list(source, this, ci, mi, numstr); list.Process(); } else if (numstr.equals_ci("LAST")) @@ -96,6 +99,8 @@ class CommandMSDel : public Command FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(mi->memos->size() - 1))); mi->Del(mi->memos->size() - 1); source.Reply(_("Memo %d has been deleted."), mi->memos->size() + 1); + if (ci) + Log(LOG_COMMAND, source, this, ci) << "on LAST memo"; } else { @@ -106,7 +111,10 @@ class CommandMSDel : public Command mi->Del(i - 1); } if (!chan.empty()) + { source.Reply(_("All memos for channel %s have been deleted."), chan.c_str()); + Log(LOG_COMMAND, source, this, ci) << "on ALL memos"; + } else source.Reply(_("All of your memos have been deleted.")); } |