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/ns_update.cpp | |
parent | 0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff) |
New event system
Diffstat (limited to 'modules/commands/ns_update.cpp')
-rw-r--r-- | modules/commands/ns_update.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/commands/ns_update.cpp b/modules/commands/ns_update.cpp index 8f5ddc330..1fa9c5b36 100644 --- a/modules/commands/ns_update.cpp +++ b/modules/commands/ns_update.cpp @@ -10,11 +10,14 @@ */ #include "module.h" +#include "modules/ns_update.h" class CommandNSUpdate : public Command { + EventHandlers<Event::NickUpdate> &onnickupdate; + public: - CommandNSUpdate(Module *creator) : Command(creator, "nickserv/update", 0, 0) + CommandNSUpdate(Module *creator, EventHandlers<Event::NickUpdate> &event) : Command(creator, "nickserv/update", 0, 0), onnickupdate(event) { this->SetDesc(_("Updates your current status, i.e. it checks for new memos")); this->RequireUser(true); @@ -31,7 +34,7 @@ class CommandNSUpdate : public Command na->last_seen = Anope::CurTime; } - FOREACH_MOD(OnNickUpdate, (u)); + this->onnickupdate(&Event::NickUpdate::OnNickUpdate, u); source.Reply(_("Status updated (memos, vhost, chmodes, flags).")); } @@ -50,10 +53,12 @@ class CommandNSUpdate : public Command class NSUpdate : public Module { CommandNSUpdate commandnsupdate; + EventHandlers<Event::NickUpdate> onnickupdate; public: - NSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - commandnsupdate(this) + NSUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , commandnsupdate(this, onnickupdate) + , onnickupdate(this, "OnNickUpdate") { } |