]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Change channel name parameter of Module::OnUserPreJoin() and Channel::JoinUser()...
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index f17f30907d3fc8aea39835882e4d3d02f5d76ed2..880d40097dbf6a88037161f875644e5be60ca48a 100644 (file)
@@ -83,13 +83,16 @@ 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)
+       ModResult OnUserPreJoin(User* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven)
        {
                if(chan && chan->IsModeSet('z'))
                {
@@ -103,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;
                        }
                }