From 8f67a184a762a3865958c82fe8b135dd61e26015 Mon Sep 17 00:00:00 2001 From: w00t Date: Sun, 24 Aug 2008 23:23:07 +0000 Subject: 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 --- src/modules/m_services.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/modules/m_services.cpp') 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 { -- cgit v1.2.3