]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sslmodes.cpp
there were two.. yes, you're right Special
[user/henk/code/inspircd.git] / src / modules / m_sslmodes.cpp
index 53542515ab65f4027674e078838a37aaa871d88e..c8eee5a0362fceade3cc1ae5615f1e4f22bb6e14 100644 (file)
@@ -1,23 +1,20 @@
 /*       +------------------------------------+
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
- *                              
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
- *      
- * Written by Craig Edwards, Craig McLure, and others.
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
- */     
+ */
 
+#include "inspircd.h"
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +z */
 
@@ -41,7 +38,7 @@ class SSLMode : public ModeHandler
                                        CUList* userlist = channel->GetUsers();
                                        for(CUList::iterator i = userlist->begin(); i != userlist->end(); i++)
                                        {
-                                               if(!i->second->GetExt("ssl", dummy))
+                                               if(!i->first->GetExt("ssl", dummy))
                                                {
                                                        source->WriteServ("490 %s %s :all members of the channel must be connected via SSL", source->nick, channel->name);
                                                        return MODEACTION_DENY;
@@ -76,12 +73,13 @@ class ModuleSSLModes : public Module
        
  public:
        ModuleSSLModes(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
 
                sslm = new SSLMode(ServerInstance);
-               ServerInstance->AddMode(sslm, 'z');
+               if (!ServerInstance->AddMode(sslm, 'z'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        void Implements(char* List)
@@ -101,7 +99,7 @@ class ModuleSSLModes : public Module
                        else
                        {
                                // Deny
-                               user->WriteServ( "489 %s %s :Cannot join channel (+z)", user->nick, cname);
+                               user->WriteServ( "489 %s %s :Cannot join channel; SSL users only (+z)", user->nick, cname);
                                return 1;
                        }
                }
@@ -141,7 +139,7 @@ class ModuleSSLModesFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleSSLModesFactory;
 }