]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cycle.cpp
Merge branch 'master+gnutlsprio'
[user/henk/code/inspircd.git] / src / modules / m_cycle.cpp
index 3dd4f41c70f54580f5143ddb2866f4e08800809d..c8b6bd8b4b82ec923e433c602a313da3ffa7d812 100644 (file)
@@ -34,7 +34,7 @@ class CommandCycle : public SplitCommand
        CmdResult HandleLocal(const std::vector<std::string> &parameters, LocalUser* user)
        {
                Channel* channel = ServerInstance->FindChan(parameters[0]);
-               std::string reason = ConvToStr("Cycling");
+               std::string reason = "Cycling";
 
                if (parameters.size() > 1)
                {
@@ -50,22 +50,16 @@ class CommandCycle : public SplitCommand
 
                if (channel->HasUser(user))
                {
-                       /*
-                        * technically, this is only ever sent locally, but pays to be safe ;p
-                        */
-                       if (IS_LOCAL(user))
+                       if (channel->GetPrefixValue(user) < VOICE_VALUE && channel->IsBanned(user))
                        {
-                               if (channel->GetPrefixValue(user) < VOICE_VALUE && channel->IsBanned(user))
-                               {
-                                       /* banned, boned. drop the message. */
-                                       user->WriteNotice("*** You may not cycle, as you are banned on channel " + channel->name);
-                                       return CMD_FAILURE;
-                               }
-
-                               channel->PartUser(user, reason);
-                               Channel::JoinUser(user, parameters[0], true);
+                               // User is banned, send an error and don't cycle them
+                               user->WriteNotice("*** You may not cycle, as you are banned on channel " + channel->name);
+                               return CMD_FAILURE;
                        }
 
+                       channel->PartUser(user, reason);
+                       Channel::JoinUser(user, parameters[0], true);
+
                        return CMD_SUCCESS;
                }
                else