]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cycle.cpp
Merge pull request #1162 from SaberUK/insp20+fix-deinstall
[user/henk/code/inspircd.git] / src / modules / m_cycle.cpp
index fafdc336cac7c6cbe1728fed4fd94e6db0c6f7b6..383e7b5a2d538bf2ea0a48298788543652522109 100644 (file)
@@ -1,19 +1,26 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * This program is free but copyrighted software; see
- *            the file COPYING for details.
+ * This file is part of InspIRCd.  InspIRCd is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
  *
- * ---------------------------------------------------
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
 
-/* $ModDesc: Provides support for unreal-style CYCLE command. */
+/* $ModDesc: Provides command CYCLE, acts as a server-side HOP command to part and rejoin a channel. */
 
 /** Handle /CYCLE
  */
@@ -53,7 +60,7 @@ class CommandCycle : public Command
                                if (channel->GetPrefixValue(user) < VOICE_VALUE && channel->IsBanned(user))
                                {
                                        /* banned, boned. drop the message. */
-                                       user->WriteServ("NOTICE "+std::string(user->nick)+" :*** You may not cycle, as you are banned on channel " + channel->name);
+                                       user->WriteServ("NOTICE "+user->nick+" :*** You may not cycle, as you are banned on channel " + channel->name);
                                        return CMD_FAILURE;
                                }
 
@@ -81,7 +88,11 @@ class ModuleCycle : public Module
        ModuleCycle()
                : cmd(this)
        {
-               ServerInstance->AddCommand(&cmd);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(cmd);
        }
 
        virtual ~ModuleCycle()
@@ -90,7 +101,7 @@ class ModuleCycle : public Module
 
        virtual Version GetVersion()
        {
-               return Version("Provides support for unreal-style CYCLE command.", VF_VENDOR);
+               return Version("Provides command CYCLE, acts as a server-side HOP command to part and rejoin a channel.", VF_VENDOR);
        }
 
 };