diff options
author | Adam <Adam@anope.org> | 2014-04-20 14:35:14 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-04-20 14:35:14 -0400 |
commit | 26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch) | |
tree | b9916f14fe35ce5c4de95c4194ca4ea0cb30812f /modules/commands/bs_kick.cpp | |
parent | 0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff) |
New event system
Diffstat (limited to 'modules/commands/bs_kick.cpp')
-rw-r--r-- | modules/commands/bs_kick.cpp | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 242043105..3a4d78c93 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -14,6 +14,7 @@ #include "module.h" #include "modules/bs_kick.h" #include "modules/bs_badwords.h" +#include "modules/bs_info.h" static Module *me; @@ -998,6 +999,8 @@ class BanDataPurger : public Timer }; class BSKick : public Module + , public EventHook<Event::BotInfoEvent> + , public EventHook<Event::Privmsg> { ExtensibleItem<BanData> bandata; ExtensibleItem<UserData> userdata; @@ -1020,6 +1023,8 @@ class BSKick : public Module BanDataPurger purger; + EventHandlers<Event::BotBan> onbotban; + BanData::Data &GetBanData(User *u, Channel *c) { BanData *bd = bandata.Require(c); @@ -1056,7 +1061,7 @@ class BSKick : public Module Anope::string mask = ci->GetIdealBan(u); ci->c->SetMode(NULL, "BAN", mask); - FOREACH_MOD(OnBotBan, (u, ci, mask)); + this->onbotban(&Event::BotBan::OnBotBan, u, ci, mask); } } @@ -1077,19 +1082,31 @@ class BSKick : public Module } public: - BSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - bandata(this, "bandata"), - userdata(this, "userdata"), - kickerdata(this, "kickerdata"), - - commandbskick(this), - commandbskickamsg(this), commandbskickbadwords(this), commandbskickbolds(this), commandbskickcaps(this), - commandbskickcolors(this), commandbskickflood(this), commandbskickitalics(this), commandbskickrepeat(this), - commandbskickreverse(this), commandbskickunderlines(this), - - commandbssetdontkickops(this), commandbssetdontkickvoices(this), - - purger(this) + BSKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , EventHook<Event::BotInfoEvent>("OnBotInfoEvent") + , EventHook<Event::Privmsg>("OnPrivmsg") + , bandata(this, "bandata") + , userdata(this, "userdata") + , kickerdata(this, "kickerdata") + + , commandbskick(this) + , commandbskickamsg(this) + , commandbskickbadwords(this) + , commandbskickbolds(this) + , commandbskickcaps(this) + , commandbskickcolors(this) + , commandbskickflood(this) + , commandbskickitalics(this) + , commandbskickrepeat(this) + , commandbskickreverse(this) + , commandbskickunderlines(this) + + , commandbssetdontkickops(this) + , commandbssetdontkickvoices(this) + + , purger(this) + + , onbotban(this, "OnBotBan") { me = this; |