]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Added ability to send and receive a challenge, dont do anything with it yet
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index 14c7166e6bd1157955645dcbf14f4c4106068dc6..3646690fb853ca51bd29025f638cb063a590b5e1 100644 (file)
@@ -2,12 +2,9 @@
  *       | 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.
  *
@@ -18,8 +15,8 @@
 #include "channels.h"
 #include "modules.h"
 #include "hashcomp.h"
-
 #include "inspircd.h"
+#include "wildcard.h"
 
 /* $ModDesc: Implements config tags which allow blocking of joins to channels */
 
@@ -37,12 +34,12 @@ class ModuleDenyChannels : public Module
                Conf = new ConfigReader(ServerInstance);
        }
        
-       virtual void OnRehash(const std::string &param)
+       virtual void OnRehash(userrec* user, const std::string &param)
        {
                DELETE(Conf);
                Conf = new ConfigReader(ServerInstance);
        }
-       
+
        virtual ~ModuleDenyChannels()
        {
                DELETE(Conf);
@@ -50,7 +47,7 @@ class ModuleDenyChannels : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR,API_VERSION);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
 
        void Implements(char* List)
@@ -62,9 +59,7 @@ class ModuleDenyChannels : public Module
        {
                for (int j =0; j < Conf->Enumerate("badchan"); j++)
                {
-                       irc::string cn = Conf->ReadValue("badchan","name",j).c_str();
-                       irc::string thischan = cname;
-                       if (thischan == cn)
+                       if (match(cname, Conf->ReadValue("badchan","name",j).c_str()))
                        {
                                if ((Conf->ReadFlag("badchan","allowopers",j)) && *user->oper)
                                {