From d0b88e61788c4b0d3e3d39097ba4e87f5cdb0454 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 27 Jul 2006 11:44:11 +0000 Subject: Allow freaky stuff with +k when coming from a server or remote user (allow +k when already a +k, or -k without correct key) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4553 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_k.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 2f06ba55c..b1cfac1e9 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -30,14 +30,14 @@ ModeAction ModeChannelKey::OnModeChange(userrec* source, userrec* dest, chanrec* /* Key is currently set and the correct key wasnt given */ return MODEACTION_DENY; } - else if (!channel->modes[CM_KEY]) + else if ((!channel->modes[CM_KEY]) || ((adding) && (!IS_LOCAL(source)))) { /* Key isnt currently set */ strlcpy(channel->key,parameter.c_str(),32); channel->modes[CM_KEY] = adding; return MODEACTION_ALLOW; } - else if ((channel->modes[CM_KEY]) && (!strcasecmp(parameter.c_str(),channel->key))) + else if (((channel->modes[CM_KEY]) && (!strcasecmp(parameter.c_str(),channel->key))) || ((!adding) && (!IS_LOCAL(source)))) { /* Key is currently set, and correct key was given */ *channel->key = 0; -- cgit v1.2.3