]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operchans.cpp
This needs some general QA-ing. Add support to new parser (introduced in 1.1) for...
[user/henk/code/inspircd.git] / src / modules / m_operchans.cpp
index 7f3b989aa32f8216b708c13194cb6c00eb11d889..6852bc6085dff4266aab59ec5f847709cfd40e5f 100644 (file)
@@ -2,20 +2,15 @@
  *       | 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.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
@@ -62,7 +57,8 @@ class ModuleOperChans : public Module
        {
                                
                oc = new OperChans(ServerInstance);
-               ServerInstance->AddMode(oc, 'O');
+               if (!ServerInstance->AddMode(oc, 'O'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        void Implements(char* List)
@@ -70,7 +66,7 @@ class ModuleOperChans : public Module
                List[I_OnUserPreJoin] = 1;
        }
 
-       virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
+       virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
        {
                if (!*user->oper)
                {
@@ -88,12 +84,13 @@ class ModuleOperChans : public Module
        
        virtual ~ModuleOperChans()
        {
+               ServerInstance->Modes->DelMode(oc);
                DELETE(oc);
        }
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
+               return Version(1,1,0,0,VF_VENDOR|VF_COMMON,API_VERSION);
        }
 };