]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_operchans.cpp
Fix m_chanlog crashing.
[user/henk/code/inspircd.git] / src / modules / m_operchans.cpp
index 4c3ae4798762b7271488794e26dca9f9970e2331..6e3ac1eada8d22fc9cbd25a9dac6fbcec3d8f0c8 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -54,14 +54,12 @@ class ModuleOperChans : public Module
        {
                                
                oc = new OperChans(ServerInstance);
-               if (!ServerInstance->AddMode(oc, 'O'))
+               if (!ServerInstance->Modes->AddMode(oc))
                        throw ModuleException("Could not add new modes!");
+               Implementation eventlist[] = { I_OnUserPreJoin };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserPreJoin] = 1;
-       }
 
        virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
        {
@@ -82,7 +80,7 @@ class ModuleOperChans : public Module
        virtual ~ModuleOperChans()
        {
                ServerInstance->Modes->DelMode(oc);
-               DELETE(oc);
+               delete oc;
        }
        
        virtual Version GetVersion()