diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-06-13 19:00:01 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-06-13 19:00:01 +0200 |
commit | 95593de52c9b89dd3dae8d79a2c76efc81d9d353 (patch) | |
tree | c99c8b3172b299a7d520faf7b5e69d0e3196aa05 /src/modes | |
parent | c25a59d9036444872d831a126c6326f3d8be5e74 (diff) |
Call Channel::SetModeParam() from the mode parser when needed instead of requiring mode handlers to do it
Diffstat (limited to 'src/modes')
-rw-r--r-- | src/modes/cmode_k.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index cb9ec5b0e..f07d47172 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -50,23 +50,8 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s } } - /* invalid keys */ - if (!parameter.length()) - return MODEACTION_DENY; - - if (parameter.rfind(' ') != std::string::npos) - return MODEACTION_DENY; - if (adding) - { - std::string ckey; - ckey.assign(parameter, 0, 32); - parameter = ckey; - channel->SetModeParam('k', parameter); - } - else - { - channel->SetModeParam('k', ""); - } + parameter = parameter.substr(0, 32); + return MODEACTION_ALLOW; } |