]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_denychans.cpp
Now has no strchr() at all.
[user/henk/code/inspircd.git] / src / modules / m_denychans.cpp
index 94e2efdb8b7f58bb67c1c645a08bfc150c1c02f5..ba66d2294e29c547000abb43b6a8a585e5995e7b 100644 (file)
@@ -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;
                                }