mirror of
https://github.com/anope/anope.git
synced 2026-06-28 21:56:37 +02:00
Fixed some events
This commit is contained in:
+1
-3
@@ -516,7 +516,7 @@ class CoreExport Module : public Extensible
|
||||
|
||||
/** Called before a XLine is deleted
|
||||
* @param u The user deleting the XLine
|
||||
* @param x The XLine, can be NULL for all XLines
|
||||
* @param x The XLine
|
||||
* @param xlm The xline manager it was deleted from
|
||||
*/
|
||||
virtual void OnDelXLine(User *u, XLine *x, XLineManager *xlm) { }
|
||||
@@ -835,7 +835,6 @@ class CoreExport Module : public Extensible
|
||||
* @param nc The nickcore of the memo being deleted
|
||||
* @param mi The memo info
|
||||
* @param m The memo
|
||||
* @param number What memo number is being deleted, can be 0 for all memos
|
||||
*/
|
||||
virtual void OnMemoDel(const NickCore *nc, MemoInfo *mi, Memo *m) { }
|
||||
|
||||
@@ -843,7 +842,6 @@ class CoreExport Module : public Extensible
|
||||
* @param ci The channel of the memo being deleted
|
||||
* @param mi The memo info
|
||||
* @param m The memo
|
||||
* @param number What memo number is being deleted, can be 0 for all memos
|
||||
*/
|
||||
virtual void OnMemoDel(ChannelInfo *ci, MemoInfo *mi, Memo *m) { }
|
||||
|
||||
|
||||
@@ -207,6 +207,8 @@ class CommandCSAKick : public Command
|
||||
if (!Number || Number > ci->GetAkickCount())
|
||||
return;
|
||||
|
||||
FOREACH_MOD(I_OnAkickDel, OnAkickDel(source.u, ci, ci->GetAkick(Number - 1)));
|
||||
|
||||
++Deleted;
|
||||
ci->EraseAkick(Number - 1);
|
||||
}
|
||||
@@ -236,6 +238,8 @@ class CommandCSAKick : public Command
|
||||
bool override = !ci->AccessFor(u).HasPriv("AKICK");
|
||||
Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "to delete " << mask;
|
||||
|
||||
FOREACH_MOD(I_OnAkickDel, OnAkickDel(u, ci, ci->GetAkick(i)));
|
||||
|
||||
ci->EraseAkick(i);
|
||||
|
||||
source.Reply(_("\002%s\002 deleted from %s autokick list."), mask.c_str(), ci->name.c_str());
|
||||
|
||||
@@ -107,13 +107,15 @@ class CommandMSDel : public Command
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ci)
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, NULL));
|
||||
else
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, NULL));
|
||||
/* Delete all memos. */
|
||||
for (unsigned i = 0, end = mi->memos.size(); i < end; ++i)
|
||||
{
|
||||
if (ci)
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(ci, mi, mi->memos[i]));
|
||||
else
|
||||
FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, mi->memos[i]));
|
||||
delete mi->memos[i];
|
||||
}
|
||||
mi->memos.clear();
|
||||
if (!chan.empty())
|
||||
source.Reply(_("All memos for channel %s have been deleted."), chan.c_str());
|
||||
|
||||
@@ -316,11 +316,11 @@ class CommandOSAKill : public Command
|
||||
void DoClear(CommandSource &source)
|
||||
{
|
||||
User *u = source.u;
|
||||
FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, NULL, akills));
|
||||
|
||||
for (unsigned i = akills->GetCount(); i > 0; --i)
|
||||
{
|
||||
XLine *x = akills->GetEntry(i - 1);
|
||||
FOREACH_MOD(I_OnDelXLine, OnDelXLine(u, x, akills));
|
||||
akills->DelXLine(x);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -660,7 +660,7 @@ void ChannelInfo::EraseAkick(unsigned index)
|
||||
{
|
||||
if (this->akick.empty() || index >= this->akick.size())
|
||||
return;
|
||||
|
||||
|
||||
delete this->akick[index];
|
||||
this->akick.erase(this->akick.begin() + index);
|
||||
}
|
||||
@@ -719,6 +719,8 @@ void ChannelInfo::EraseBadWord(unsigned index)
|
||||
{
|
||||
if (this->badwords.empty() || index >= this->badwords.size())
|
||||
return;
|
||||
|
||||
FOREACH_MOD(I_OnBadWordDel, OnBadWordDel(this, this->badwords[index]));
|
||||
|
||||
delete this->badwords[index];
|
||||
this->badwords.erase(this->badwords.begin() + index);
|
||||
|
||||
Reference in New Issue
Block a user