]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Probably wont compile yet - purge_empty_channels refactor
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index 1da4158d3caaaa6c2931790cf6ba2e90d5aca4b2..ba66d2294e29c547000abb43b6a8a585e5995e7b 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -14,9 +14,6 @@
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include <stdio.h>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
@@ -33,13 +30,18 @@ class ModuleDenyChannels : public Module
        ConfigReader *Conf;
 
  public:
-       ModuleDenyChannels(Server* Me)
-               : Module::Module(Me)
+       ModuleDenyChannels(Server* Me) : Module::Module(Me)
        {
                Srv = Me;
                Conf = new ConfigReader;
        }
        
+       virtual void OnRehash(std::string param)
+       {
+               delete Conf;
+               Conf = new ConfigReader;
+       }
+       
        virtual ~ModuleDenyChannels()
        {
                delete Conf;
@@ -52,7 +54,7 @@ class ModuleDenyChannels : public Module
 
        void Implements(char* List)
        {
-               List[I_OnUserPreJoin] = 1;
+               List[I_OnUserPreJoin] = List[I_OnRehash] = 1;
        }
 
         virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
@@ -63,7 +65,7 @@ class ModuleDenyChannels : public Module
                        irc::string thischan = cname;
                        if (thischan == cn)
                        {
-                               if ((Conf->ReadFlag("badchan","allowopers",j)) && (strchr(user->modes,'o')))
+                               if ((Conf->ReadFlag("badchan","allowopers",j)) && *user->oper)
                                {
                                        return 0;
                                }