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/cs_drop.cpp | |
parent | 0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff) |
New event system
Diffstat (limited to 'modules/commands/cs_drop.cpp')
-rw-r--r-- | modules/commands/cs_drop.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index 03d24a18d..3b6c82ed0 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -10,11 +10,14 @@ */ #include "module.h" +#include "modules/cs_drop.h" class CommandCSDrop : public Command { + EventHandlers<Event::ChanDrop> &onchandrop; + public: - CommandCSDrop(Module *creator) : Command(creator, "chanserv/drop", 1, 2) + CommandCSDrop(Module *creator, EventHandlers<Event::ChanDrop> &event) : Command(creator, "chanserv/drop", 1, 2), onchandrop(event) { this->SetDesc(_("Cancel the registration of a channel")); this->SetSyntax(_("\037channel\037 \037channel\037")); @@ -49,8 +52,7 @@ class CommandCSDrop : public Command return; } - EventReturn MOD_RESULT; - FOREACH_RESULT(OnChanDrop, MOD_RESULT, (source, ci)); + EventReturn MOD_RESULT = this->onchandrop(&Event::ChanDrop::OnChanDrop, source, ci); if (MOD_RESULT == EVENT_STOP) return; @@ -84,9 +86,12 @@ class CommandCSDrop : public Command class CSDrop : public Module { CommandCSDrop commandcsdrop; + EventHandlers<Event::ChanDrop> onchandrop; public: - CSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandcsdrop(this) + CSDrop(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , commandcsdrop(this, onchandrop) + , onchandrop(this, "OnChanDrop") { } |