summaryrefslogtreecommitdiff
path: root/modules/commands/bs_info.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
committerAdam <Adam@anope.org>2014-04-20 14:35:14 -0400
commit26ac315192e0d8a04d50e910697ab794eedf0cc1 (patch)
treeb9916f14fe35ce5c4de95c4194ca4ea0cb30812f /modules/commands/bs_info.cpp
parent0b6476f06ff9ce06545c421143c7d7163c750aa5 (diff)
New event system
Diffstat (limited to 'modules/commands/bs_info.cpp')
-rw-r--r--modules/commands/bs_info.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp
index b04a62c8f..49775a053 100644
--- a/modules/commands/bs_info.cpp
+++ b/modules/commands/bs_info.cpp
@@ -10,7 +10,9 @@
*
*
*/
+
#include "module.h"
+#include "modules/bs_info.h"
class CommandBSInfo : public Command
{
@@ -36,8 +38,10 @@ class CommandBSInfo : public Command
buffers.push_back(buf);
}
+ EventHandlers<Event::BotInfoEvent> &onbotinfo;
+
public:
- CommandBSInfo(Module *creator) : Command(creator, "botserv/info", 1, 1)
+ CommandBSInfo(Module *creator, EventHandlers<Event::BotInfoEvent> &event) : Command(creator, "botserv/info", 1, 1), onbotinfo(event)
{
this->SetSyntax(_("{\037channel\037 | \037nickname\037}"));
}
@@ -59,7 +63,7 @@ class CommandBSInfo : public Command
info[_("Options")] = bi->oper_only ? _("Private") : _("None");
info[_("Used on")] = stringify(bi->GetChannelCount()) + " channel(s)";
- FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
+ this->onbotinfo(&Event::BotInfoEvent::OnBotInfo, source, bi, ci, info);
std::vector<Anope::string> replies;
info.Process(replies);
@@ -90,7 +94,7 @@ class CommandBSInfo : public Command
Anope::string enabled = Language::Translate(source.nc, _("Enabled"));
Anope::string disabled = Language::Translate(source.nc, _("Disabled"));
- FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
+ this->onbotinfo(&Event::BotInfoEvent::OnBotInfo, source, bi, ci, info);
std::vector<Anope::string> replies;
info.Process(replies);
@@ -123,10 +127,11 @@ class CommandBSInfo : public Command
class BSInfo : public Module
{
CommandBSInfo commandbsinfo;
+ EventHandlers<Event::BotInfoEvent> onbotinfo;
public:
- BSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR),
- commandbsinfo(this)
+ BSInfo(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR)
+ , commandbsinfo(this, onbotinfo), onbotinfo(this, "OnBotInfo")
{
}