]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
m_spanningtree Remove duplicate code for sending channel messages from RouteCommand()
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index 65933cc141126a265f21a2c1bbcbfa987669fe5b..191ca10f1c5cc06b92ca4124bdcb89c70438479e 100644 (file)
@@ -24,8 +24,6 @@
 #include "inspircd.h"
 #include "modules/ssl.h"
 
-/* $ModDesc: Provides channel mode +z to allow for Secure/SSL only channels */
-
 /** Handle channel mode +z
  */
 class SSLMode : public ModeHandler
@@ -43,7 +41,7 @@ class SSLMode : public ModeHandler
        {
                if (adding)
                {
-                       if (!channel->IsModeSet('z'))
+                       if (!channel->IsModeSet(this))
                        {
                                if (IS_LOCAL(source))
                                {
@@ -61,7 +59,7 @@ class SSLMode : public ModeHandler
                                                }
                                        }
                                }
-                               channel->SetMode('z',true);
+                               channel->SetMode(this, true);
                                return MODEACTION_ALLOW;
                        }
                        else
@@ -71,9 +69,9 @@ class SSLMode : public ModeHandler
                }
                else
                {
-                       if (channel->IsModeSet('z'))
+                       if (channel->IsModeSet(this))
                        {
-                               channel->SetMode('z',false);
+                               channel->SetMode(this, false);
                                return MODEACTION_ALLOW;
                        }
 
@@ -96,13 +94,11 @@ class ModuleSSLModes : public Module
        void init() CXX11_OVERRIDE
        {
                ServerInstance->Modules->AddService(sslm);
-               Implementation eventlist[] = { I_OnUserPreJoin, I_OnCheckBan, I_On005Numeric };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        ModResult OnUserPreJoin(LocalUser* user, Channel* chan, const std::string& cname, std::string& privs, const std::string& keygiven) CXX11_OVERRIDE
        {
-               if(chan && chan->IsModeSet('z'))
+               if(chan && chan->IsModeSet(sslm))
                {
                        if (!sslm.API)
                                return MOD_RES_DENY;