From 95593de52c9b89dd3dae8d79a2c76efc81d9d353 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 13 Jun 2013 19:00:01 +0200 Subject: Call Channel::SetModeParam() from the mode parser when needed instead of requiring mode handlers to do it --- src/modes/cmode_k.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/modes') 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; } -- cgit v1.2.3