summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-27 11:44:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-27 11:44:11 +0000
commitd0b88e61788c4b0d3e3d39097ba4e87f5cdb0454 (patch)
tree835abbfc330f9e27dce6122ecac3be4e0c6de939
parentda404eb4154d8fe93258ec4adf190a97c04065b2 (diff)
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
-rw-r--r--src/modes/cmode_k.cpp4
1 files 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;