X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sslmodes.cpp;h=c81c7420783747b7d0d560b475224a5a5a925a5c;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=ef63b2511733b8369155b2a3678989acaf9357e8;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index ef63b2511..c81c74207 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -83,10 +83,13 @@ class ModuleSSLModes : public Module ModuleSSLModes() : sslm(this) { - if (!ServerInstance->Modes->AddMode(&sslm)) - throw ModuleException("Could not add new modes!"); + } + + void init() + { + ServerInstance->Modules->AddService(sslm); Implementation eventlist[] = { I_OnUserPreJoin, I_OnCheckBan, I_On005Numeric }; - 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) @@ -113,7 +116,7 @@ class ModuleSSLModes : public Module ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) { - if (mask[0] == 'z' && mask[1] == ':') + if ((mask.length() > 2) && (mask[0] == 'z') && (mask[1] == ':')) { UserCertificateRequest req(user, this); req.Send();