diff options
-rw-r--r-- | src/modules/m_services.cpp | 10 |
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 { |