summaryrefslogtreecommitdiff
path: root/src/bots.cpp
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-18 22:59:16 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-18 22:59:16 +0000
commit187c45059a692e63c3ea1e1176d98e080ccf374b (patch)
tree882371e64c00f851546078ed328269046ec15b12 /src/bots.cpp
parent3fe5aa037ac907a2e557cc5019588344eaf8dc9f (diff)
Move assign and unassign to new events, allow for halting too should modules desire that.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2107 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/bots.cpp')
-rw-r--r--src/bots.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 0ba119ed9..095d16167 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -10,6 +10,7 @@
*/
#include "services.h"
+#include "modules.h"
BotInfo::BotInfo(const char *nnick)
{
@@ -89,6 +90,11 @@ void BotInfo::RejoinAll()
void BotInfo::Assign(User *u, ChannelInfo *ci)
{
+ EventReturn MOD_RESULT = EVENT_CONTINUE;
+ FOREACH_RESULT(I_OnBotAssign, OnBotAssign(u, ci, this));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
+
if (ci->bi)
{
if (u)
@@ -101,13 +107,14 @@ void BotInfo::Assign(User *u, ChannelInfo *ci)
this->chancount++;
if (ci->c && ci->c->usercount >= BSMinUsers)
bot_join(ci);
-
- send_event(EVENT_BOT_ASSIGN, 2, ci->name, this->nick);
}
void BotInfo::UnAssign(User *u, ChannelInfo *ci)
{
- send_event(EVENT_BOT_UNASSIGN, 2, ci->name, ci->bi->nick);
+ EventReturn MOD_RESULT = EVENT_CONTINUE;
+ FOREACH_RESULT(I_OnBotUnAssign, OnBotUnAssign(u, ci));
+ if (MOD_RESULT == EVENT_STOP)
+ return;
if (u && ci->c && ci->c->usercount >= BSMinUsers)
ircdproto->SendPart(ci->bi, ci->name, "UNASSIGN from %s", u->nick);