From: w00t Date: Sun, 24 Aug 2008 23:23:07 +0000 (+0000) Subject: Forward port r10255: prevent redundant mode changes (thanks to mixx941 for my noticin... X-Git-Tag: v2.0.23~2761 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=8f67a184a762a3865958c82fe8b135dd61e26015;p=user%2Fhenk%2Fcode%2Finspircd.git Forward port r10255: prevent redundant mode changes (thanks to mixx941 for my noticing this) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10256 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index bc6c68864..9b10b2f5e 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -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 {