]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_restrictchans.cpp
Just to mess with om's head, remove helperfuncs.h from everywhere
[user/henk/code/inspircd.git] / src / modules / m_restrictchans.cpp
index cd94ba3feab17a7fc9abbfc34419534f13848486..1b7d4104a50bcbacf1c19cd1f870f543f948885a 100644 (file)
@@ -21,19 +21,20 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
+
+#include "inspircd.h"
 
 /* $ModDesc: Only opers may create new channels if this module is loaded */
 
 class ModuleRestrictChans : public Module
 {
-       Server* Srv;
+       
 
        std::map<irc::string,int> allowchans;
 
        void ReadConfig()
        {
-               ConfigReader* MyConf = new ConfigReader();
+               ConfigReader* MyConf = new ConfigReader(ServerInstance);
                allowchans.clear();
                for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)
                {
@@ -42,14 +43,14 @@ class ModuleRestrictChans : public Module
                        irc::string channel = txt.c_str();
                        allowchans[channel] = 1;
                }
-               delete MyConf;
+               DELETE(MyConf);
        }
 
  public:
-       ModuleRestrictChans(Server* Me)
+       ModuleRestrictChans(InspIRCd* Me)
                : Module::Module(Me)
        {
-               Srv = Me;
+               
                ReadConfig();
        }
 
@@ -72,7 +73,7 @@ class ModuleRestrictChans : public Module
                        // channel does not yet exist (record is null, about to be created IF we were to allow it)
                        if (!chan)
                        {
-                               WriteServ(user->fd,"530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
+                               user->WriteServ("530 %s %s :Only IRC operators may create new channels",user->nick,cname,cname);
                                return 1;
                        }
                }
@@ -101,7 +102,7 @@ class ModuleRestrictChansFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule(Server* Me)
+       virtual Module * CreateModule(InspIRCd* Me)
        {
                return new ModuleRestrictChans(Me);
        }