From a53719d91e441aba331a144ed8c8b3debbc5c847 Mon Sep 17 00:00:00 2001 From: Adam- Date: Tue, 13 Apr 2010 02:45:33 +0000 Subject: [PATCH] Remove +r from nonregistered channels git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2890 5417fbe8-f217-4b02-8779-1006273d7864 --- src/channels.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/channels.c b/src/channels.c index c5e35a473..60deace17 100644 --- a/src/channels.c +++ b/src/channels.c @@ -378,12 +378,22 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En ci->SetFlag(CI_PERSIST); } - /* Check for mlock */ - - /* Non registered channel, no mlock */ - if (!ci || !EnforceMLock || MOD_RESULT == EVENT_STOP) + /* Check if we should enforce mlock */ + if (!EnforceMLock || MOD_RESULT == EVENT_STOP) return; + /* Non registered channels can not be +r */ + if (!ci && HasMode(CMODE_REGISTERED)) + { + RemoveMode(NULL, CMODE_REGISTERED); + } + + /* Non registered channel has no mlock */ + if (!ci) + { + return; + } + /* If this channel has this mode locked negative */ if (ci->HasMLock(cm->Name, false)) {