summaryrefslogtreecommitdiff
path: root/modules/commands/ms_del.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-20 15:21:32 -0400
committerAdam <Adam@anope.org>2013-09-20 15:21:32 -0400
commit8641b995c43593289dc4e66cbf980069b80d6d6b (patch)
tree07b4c53e9b69300b7d24ab45988412d05ca214dd /modules/commands/ms_del.cpp
parentb880240d727a4375522851daea0abf468f588a78 (diff)
Merge the two memo del events into one. Since they had the same name it was confusing the event system
Diffstat (limited to 'modules/commands/ms_del.cpp')
-rw-r--r--modules/commands/ms_del.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/modules/commands/ms_del.cpp b/modules/commands/ms_del.cpp
index c789e697b..963239f7f 100644
--- a/modules/commands/ms_del.cpp
+++ b/modules/commands/ms_del.cpp
@@ -26,10 +26,7 @@ class MemoDelCallback : public NumberList
if (!number || number > mi->memos->size())
return;
- if (ci)
- FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(number - 1)));
- else
- FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(number - 1)));
+ FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(number - 1)));
mi->Del(number - 1);
source.Reply(_("Memo %d has been deleted."), number);
@@ -96,10 +93,7 @@ class CommandMSDel : public Command
else if (numstr.equals_ci("LAST"))
{
/* Delete last memo. */
- if (ci)
- FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(mi->memos->size() - 1)));
- else
- FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(mi->memos->size() - 1)));
+ 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);
}
@@ -108,10 +102,7 @@ class CommandMSDel : public Command
/* Delete all memos. */
for (unsigned i = 0, end = mi->memos->size(); i < end; ++i)
{
- if (ci)
- FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(i)));
- else
- FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(i)));
+ FOREACH_MOD(OnMemoDel, (ci ? ci->name : source.nc->display, mi, mi->GetMemo(i)));
delete mi->GetMemo(i);
}
mi->memos->clear();