X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodes%2Fcmode_k.cpp;h=5e55ce972fe751af9d3d2cf8d445548b462bdb56;hb=354cf0401283c67a6cf8962dfb55fc0558662cdd;hp=b1cfac1e9c3340718c6589da20af20783870c42d;hpb=d0b88e61788c4b0d3e3d39097ba4e87f5cdb0454;p=user%2Fhenk%2Fcode%2Finspircd.git 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 ModeChannelKey::ModeSet(userrec* source, userrec* de ModeAction ModeChannelKey::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, 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; } }