X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cycle.cpp;h=b23bf5b92764a0e0654c6142ce3c602564505384;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=b28edde83de2bf49294648422d7f818cd82c262b;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cycle.cpp b/src/modules/m_cycle.cpp index b28edde83..b23bf5b92 100644 --- a/src/modules/m_cycle.cpp +++ b/src/modules/m_cycle.cpp @@ -20,7 +20,7 @@ #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 */ @@ -60,13 +60,13 @@ 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; } channel->PartUser(user, reason); - Channel::JoinUser(user, parameters[0].c_str(), true, "", false, ServerInstance->Time()); + Channel::JoinUser(user, parameters[0], true, "", false, ServerInstance->Time()); } return CMD_SUCCESS; @@ -84,22 +84,22 @@ class CommandCycle : public Command class ModuleCycle : public Module { CommandCycle cmd; + public: ModuleCycle() : cmd(this) { - ServerInstance->AddCommand(&cmd); } - virtual ~ModuleCycle() + void init() { + ServerInstance->Modules->AddService(cmd); } 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); } - }; MODULE_INIT(ModuleCycle)