X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operchans.cpp;h=ca948d95b3c195e955ffa24bfd84d7a5aad7bc74;hb=f6aea98dc5c3d9e2e54cde5aaf3198eee3c1ebfb;hp=8db2a4041b4bc99a121b0ff2deb3ef6b2bca91ff;hpb=6b14ac1562dda1492e7ca44c2306e2432200b8cc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 8db2a4041..ca948d95b 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -40,10 +40,13 @@ class ModuleOperChans : public Module public: ModuleOperChans() : oc(this) { - if (!ServerInstance->Modes->AddMode(&oc)) - throw ModuleException("Could not add new modes!"); + } + + void init() + { + ServerInstance->Modules->AddService(oc); Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric, I_OnUserPreJoin }; - ServerInstance->Modules->Attach(eventlist, this, 3); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)