summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-24 23:23:07 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-24 23:23:07 +0000
commit8f67a184a762a3865958c82fe8b135dd61e26015 (patch)
tree87966130af12db7bf8b99b23b80744641e977a37 /src/modules
parentb708dff6d2897271321764117582a47699e72876 (diff)
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
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_services.cpp10
1 files changed, 8 insertions, 2 deletions
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
{