summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modes/cmode_k.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index b1cfac1e9..5e55ce972 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -23,11 +23,12 @@ std::pair<bool,std::string> ModeChannelKey::ModeSet(userrec* source, userrec* de
ModeAction ModeChannelKey::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
- if (channel->modes[CM_KEY] != adding)
+ if ((channel->modes[CM_KEY] != adding) || (!IS_LOCAL(source)))
{
- if ((channel->modes[CM_KEY]) && (strcasecmp(parameter.c_str(),channel->key)))
+ if (((channel->modes[CM_KEY]) && (strcasecmp(parameter.c_str(),channel->key))) && (IS_LOCAL(source)))
{
/* Key is currently set and the correct key wasnt given */
+ log(DEBUG,"Key Cond 2");
return MODEACTION_DENY;
}
else if ((!channel->modes[CM_KEY]) || ((adding) && (!IS_LOCAL(source))))
@@ -44,10 +45,12 @@ ModeAction ModeChannelKey::OnModeChange(userrec* source, userrec* dest, chanrec*
channel->modes[CM_KEY] = adding;
return MODEACTION_ALLOW;
}
+ log(DEBUG,"Key Cond three");
return MODEACTION_DENY;
}
else
{
+ log(DEBUG,"Key Condition one");
return MODEACTION_DENY;
}
}