X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sslmodes.cpp;h=d862a07060ec278bdc2e21771373a846c1439f4a;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=fb43422fd89603382ca1394a50075d3c5c88bc82;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index fb43422fd..d862a0706 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -22,7 +22,7 @@ #include "inspircd.h" -#include "ssl.h" +#include "modules/ssl.h" /* $ModDesc: Provides channel mode +z to allow for Secure/SSL only channels */ @@ -87,13 +87,12 @@ class ModuleSSLModes : public Module void init() { - if (!ServerInstance->Modes->AddMode(&sslm)) - throw ModuleException("Could not add new modes!"); + 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) + ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) { if(chan && chan->IsModeSet('z')) { @@ -107,7 +106,7 @@ class ModuleSSLModes : public Module else { // Deny - user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick.c_str(), cname); + user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick.c_str(), cname.c_str()); return MOD_RES_DENY; } } @@ -127,13 +126,9 @@ class ModuleSSLModes : public Module return MOD_RES_PASSTHRU; } - ~ModuleSSLModes() + void On005Numeric(std::map& tokens) { - } - - void On005Numeric(std::string &output) - { - ServerInstance->AddExtBanChar('z'); + tokens["EXTBAN"].push_back('z'); } Version GetVersion() @@ -142,6 +137,4 @@ class ModuleSSLModes : public Module } }; - MODULE_INIT(ModuleSSLModes) -