X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_botmode.cpp;h=71f327dd3fe92a115cf82fb997ab1db1c8d63976;hb=e9e75e50bc25e67af22dd88b39b12217a553d5cb;hp=5871b92278d11f8793625af90c30977279e04ffc;hpb=85b9374a7a866e659d8289556a3d7c1c93f9dc9e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 5871b9227..71f327dd3 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -38,15 +38,13 @@ class ModuleBotMode : public Module ModuleBotMode() : bm(this) { - if (!ServerInstance->Modes->AddMode(&bm)) - throw ModuleException("Could not add new modes!"); - Implementation eventlist[] = { I_OnWhois }; - ServerInstance->Modules->Attach(eventlist, this, 1); } - - virtual ~ModuleBotMode() + void init() { + ServerInstance->Modules->AddService(bm); + Implementation eventlist[] = { I_OnWhois }; + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } virtual Version GetVersion() @@ -58,11 +56,9 @@ class ModuleBotMode : public Module { if (dst->IsModeSet('B')) { - ServerInstance->SendWhoisLine(src, dst, 335, std::string(src->nick)+" "+std::string(dst->nick)+" :is a bot on "+ServerInstance->Config->Network); + ServerInstance->SendWhoisLine(src, dst, 335, src->nick+" "+dst->nick+" :is a bot on "+ServerInstance->Config->Network); } } - }; - MODULE_INIT(ModuleBotMode)