]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_redirect.cpp
A little less debug saying WEEEE :]
[user/henk/code/inspircd.git] / src / modules / m_redirect.cpp
index 46b8fbe195717d5b349408e44623898c6f1ae2e6..9dc8aa5b72c8e0ba31a152f1a0cb9eeade722f14 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
@@ -36,7 +36,7 @@ class Redirect : public ModeHandler
                return (their_param < our_param);
        }
        
-       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding)
+       ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                if (adding)
                {
@@ -105,14 +105,12 @@ class ModuleRedirect : public Module
        {
                
                re = new Redirect(ServerInstance);
-               if (!ServerInstance->AddMode(re, 'L'))
+               if (!ServerInstance->Modes->AddMode(re))
                        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)
        {
@@ -134,7 +132,7 @@ class ModuleRedirect : public Module
                                        }
 
                                        user->WriteServ("470 %s :%s has become full, so you are automatically being transferred to the linked channel %s", user->nick, cname, channel.c_str());
-                                       Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", ServerInstance->Time(true));
+                                       Channel::JoinUser(ServerInstance, user, channel.c_str(), false, "", false, ServerInstance->Time());
                                        return 1;
                                }
                        }
@@ -145,7 +143,7 @@ class ModuleRedirect : public Module
        virtual ~ModuleRedirect()
        {
                ServerInstance->Modes->DelMode(re);
-               DELETE(re);
+               delete re;
        }
        
        virtual Version GetVersion()