summaryrefslogtreecommitdiff
path: root/src/chanserv.c
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-03 02:05:45 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-03 02:05:45 +0000
commit921ddbd517a8575205931b10ad66f6607e0f5890 (patch)
treeed5a0c0f138fdeb16db52a95db51fe8d57ace2f1 /src/chanserv.c
parent65deeaf1e61242da81ca62059bcc3d5a342edcb6 (diff)
Added OnPreNickExpire and OnPreChanExpire events, which can keep nicks and channels from expiring
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2605 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/chanserv.c')
-rw-r--r--src/chanserv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/chanserv.c b/src/chanserv.c
index 991b708ef..dc0cca07f 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -1449,10 +1449,17 @@ void expire_chans()
&& !(ci->
flags & (CI_FORBIDDEN | CI_NO_EXPIRE | CI_SUSPENDED)))
{
- FOREACH_MOD(I_OnChanExpire, OnChanExpire(ci->name));
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnPreChanExpire, OnPreChanExpire(ci));
+ if (MOD_RESULT == EVENT_STOP)
+ continue;
+
+ char *chname = sstrdup(ci->name);
alog("Expiring channel %s (founder: %s)", ci->name,
(ci->founder ? ci->founder->display : "(none)"));
delchan(ci);
+ FOREACH_MOD(I_OnChanExpire, OnChanExpire(chname));
+ delete [] chname;
}
}
}