X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nokicks.cpp;h=1be389bf767ab53c044393ac885b5a866f883876;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=0d380facdd532f775e3fb73826ca953c0c197f60;hpb=77e325c3e09229c4ee976ea1ed9ea8383de02de3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index 0d380facd..1be389bf7 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -38,15 +38,18 @@ class ModuleNoKicks : public Module ModuleNoKicks() : nk(this) { - if (!ServerInstance->Modes->AddMode(&nk)) - throw ModuleException("Could not add new modes!"); + } + + void init() + { + ServerInstance->Modules->AddService(nk); Implementation eventlist[] = { I_OnUserPreKick, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - void On005Numeric(std::string &output) + void On005Numeric(std::map& tokens) { - ServerInstance->AddExtBanChar('Q'); + tokens["EXTBAN"].push_back('Q'); } ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason) @@ -60,15 +63,10 @@ class ModuleNoKicks : public Module return MOD_RES_PASSTHRU; } - ~ModuleNoKicks() - { - } - Version GetVersion() { return Version("Provides channel mode +Q to prevent kicks on the channel.", VF_VENDOR); } }; - MODULE_INIT(ModuleNoKicks)