mirror of
https://github.com/anope/anope.git
synced 2026-07-08 07:43:15 +02:00
Initially attach all modules to all events, and detach them as the events are run if they are not implemented per module
This commit is contained in:
@@ -27,9 +27,9 @@ class MemoDelCallback : public NumberList
|
||||
return;
|
||||
|
||||
if (ci)
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(number - 1)));
|
||||
FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(number - 1)));
|
||||
else
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(number - 1)));
|
||||
FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(number - 1)));
|
||||
|
||||
mi->Del(number - 1);
|
||||
source.Reply(_("Memo %d has been deleted."), number);
|
||||
@@ -97,9 +97,9 @@ class CommandMSDel : public Command
|
||||
{
|
||||
/* Delete last memo. */
|
||||
if (ci)
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(mi->memos->size() - 1)));
|
||||
FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(mi->memos->size() - 1)));
|
||||
else
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(mi->memos->size() - 1)));
|
||||
FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(mi->memos->size() - 1)));
|
||||
mi->Del(mi->memos->size() - 1);
|
||||
source.Reply(_("Memo %d has been deleted."), mi->memos->size() + 1);
|
||||
}
|
||||
@@ -109,9 +109,9 @@ class CommandMSDel : public Command
|
||||
for (unsigned i = 0, end = mi->memos->size(); i < end; ++i)
|
||||
{
|
||||
if (ci)
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->GetMemo(i)));
|
||||
FOREACH_MOD(OnMemoDel, (ci, mi, mi->GetMemo(i)));
|
||||
else
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(source.nc, mi, mi->GetMemo(i)));
|
||||
FOREACH_MOD(OnMemoDel, (source.nc, mi, mi->GetMemo(i)));
|
||||
delete mi->GetMemo(i);
|
||||
}
|
||||
mi->memos->clear();
|
||||
|
||||
Reference in New Issue
Block a user