summaryrefslogtreecommitdiff
path: root/src/modes
diff options
context:
space:
mode:
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/cmode_k.cpp19
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;
}