]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operjoin.cpp
Untested! New m_watch that should be hundreds of times faster (im not joking either)
[user/henk/code/inspircd.git] / src / modules / m_operjoin.cpp
index a0a81f7ed8c5e78b87dfc49999e47e6d5078e6fd..5df02da1ef172fd606043b896b412cc6053eca65 100644 (file)
@@ -5,16 +5,19 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
+
+#include "inspircd.h"
 
 /* $ModDesc: Forces opers to join the specified channel(s) on oper-up */
 
+
+
 class ModuleOperjoin : public Module
 {
        private:
                std::string operChan;
                ConfigReader* conf;
-               Server* Srv;
+               
 
                int tokenize(const string &str, std::vector<std::string> &tokens)
                {
@@ -36,11 +39,11 @@ class ModuleOperjoin : public Module
                }
 
        public:
-               ModuleOperjoin(Server* Me)
+               ModuleOperjoin(InspIRCd* Me)
                        : Module::Module(Me)
                {
-                       Srv = Me;
-                       conf = new ConfigReader;
+                       
+                       conf = new ConfigReader(ServerInstance);
                        operChan = conf->ReadValue("operjoin", "channel", 0);
                }
 
@@ -52,7 +55,7 @@ class ModuleOperjoin : public Module
                virtual void OnRehash(const std::string &parameter)
                {
                        DELETE(conf);
-                       conf = new ConfigReader;
+                       conf = new ConfigReader(ServerInstance);
                }
 
                virtual ~ModuleOperjoin()
@@ -62,7 +65,7 @@ class ModuleOperjoin : public Module
 
                virtual Version GetVersion()
                {
-                       return Version(1,0,0,1,VF_VENDOR);
+                       return Version(1,1,0,1,VF_VENDOR,API_VERSION);
                }
 
                virtual void OnPostOper(userrec* user, const std::string &opertype)
@@ -72,9 +75,7 @@ class ModuleOperjoin : public Module
                                std::vector<std::string> operChans;
                                tokenize(operChan,operChans);
                                for(std::vector<std::string>::iterator it = operChans.begin(); it != operChans.end(); it++)
-                               {
-                                       Srv->JoinUserToChannel(user,(*it),"");
-                               }
+                                       chanrec::JoinUser(ServerInstance, user, it->c_str(), false);
                        }
 
                }
@@ -92,7 +93,7 @@ class ModuleOperjoinFactory : public ModuleFactory
                {
                }
 
-               virtual Module * CreateModule(Server* Me)
+               virtual Module * CreateModule(InspIRCd* Me)
                {
                        return new ModuleOperjoin(Me);
                }