X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_botmode.cpp;h=b29c58240689be37d9e86a4d8be12193c860ef11;hb=68211809ee3111bdc9609fbd46dc3c875fbb5ea6;hp=5871b92278d11f8793625af90c30977279e04ffc;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 5871b9227..b29c58240 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -38,12 +38,14 @@ 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); } + void init() + { + ServerInstance->Modules->AddService(bm); + Implementation eventlist[] = { I_OnWhois }; + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); + } virtual ~ModuleBotMode() { @@ -58,7 +60,7 @@ 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); } }