]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
Add m_clearchan which removes users from a channel without sending n*(n+1)/2 QUIT...
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index 40398b3acc75879f3f8b9c8c348559c9a9b850f6..6ac07434f7c0f9c2a7c615112ba35190042a4880 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
@@ -54,9 +52,9 @@ class SSLMode : public ModeHandler
                                        for(UserMembCIter i = userlist->begin(); i != userlist->end(); i++)
                                        {
                                                ssl_cert* cert = API->GetCertificate(i->first);
-                                               if (!cert && !ServerInstance->ULine(i->first->server))
+                                               if (!cert && !i->first->server->IsULine())
                                                {
-                                                       source->WriteNumeric(ERR_ALLMUSTSSL, "%s %s :all members of the channel must be connected via SSL", source->nick.c_str(), channel->name.c_str());
+                                                       source->WriteNumeric(ERR_ALLMUSTSSL, "%s :all members of the channel must be connected via SSL", channel->name.c_str());
                                                        return MODEACTION_DENY;
                                                }
                                        }
@@ -93,13 +91,6 @@ 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(sslm))
@@ -116,7 +107,7 @@ class ModuleSSLModes : public Module
                        else
                        {
                                // Deny
-                               user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick.c_str(), cname.c_str());
+                               user->WriteNumeric(489, "%s :Cannot join channel; SSL users only (+z)", cname.c_str());
                                return MOD_RES_DENY;
                        }
                }