]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Forward port r10255: prevent redundant mode changes (thanks to mixx941 for my noticin...
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Aug 2008 23:23:07 +0000 (23:23 +0000)
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 24 Aug 2008 23:23:07 +0000 (23:23 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10256 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_services.cpp

index bc6c68864533e698244258df253a03f7f1718011..9b10b2f5e5425a62f413c1f00c503ef9c9cb15bc 100644 (file)
@@ -30,8 +30,14 @@ class Channel_r : public ModeHandler
                // only a u-lined server may add or remove the +r mode.
                if ((ServerInstance->ULine(source->nick.c_str())) || (ServerInstance->ULine(source->server)) || (!*source->server || (source->nick.find('.') != std::string::npos)))
                {
-                       channel->SetMode('r',adding);
-                       return MODEACTION_ALLOW;
+                       // Only change the mode if it's not redundant
+                       if ((adding && !channel->IsModeSet('r')) || (!adding && channel->IsModeSet('r')))
+                       {
+                               channel->SetMode('r',adding);
+                               return MODEACTION_ALLOW;
+                       }
+
+                       return MODEACTION_DENY;
                }
                else
                {