From f25f6319d5ae3eb1c48fcc84cb49c9cf08c439a5 Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 6 Mar 2009 10:04:51 +0000 Subject: Drop channel keys if they are identical to the already-set key (fix for bug #756, reported by Taros) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11178 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_k.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 3540346b5..2ee839efa 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -73,6 +73,11 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s /* Key is currently set and the correct key wasnt given */ return MODEACTION_DENY; } + else if (channel->IsModeSet('k') && parameter == channel->GetModeParameter('k')) + { + /* Key is currently set, setting to the same as it already is.. drop it */ + return MODEACTION_DENY; + } else if ((!channel->IsModeSet('k')) || ((adding) && (!IS_LOCAL(source)))) { /* Key isnt currently set */ -- cgit v1.2.3