summaryrefslogtreecommitdiffstats
path: root/app/command_channel_rename.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-08-29 05:48:38 -0400
committerSaturnino Abril <saturnino.abril@gmail.com>2017-08-29 17:48:38 +0800
commit82a8bd99cc5fe59fe4577c9b0d2c06a82c89e628 (patch)
treecfea354f60ce09ae143e46c52d0fb3460c61926c /app/command_channel_rename.go
parentce77d836fc7968f84041bc33587e54098b745357 (diff)
downloadchat-82a8bd99cc5fe59fe4577c9b0d2c06a82c89e628.tar.gz
chat-82a8bd99cc5fe59fe4577c9b0d2c06a82c89e628.tar.bz2
chat-82a8bd99cc5fe59fe4577c9b0d2c06a82c89e628.zip
Enforce channel display name limits on slash command (#7309)
Diffstat (limited to 'app/command_channel_rename.go')
-rw-r--r--app/command_channel_rename.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/command_channel_rename.go b/app/command_channel_rename.go
index f18b127ad..ef034b399 100644
--- a/app/command_channel_rename.go
+++ b/app/command_channel_rename.go
@@ -53,6 +53,10 @@ func (me *RenameProvider) DoCommand(args *model.CommandArgs, message string) *mo
if len(message) == 0 {
return &model.CommandResponse{Text: args.T("api.command_channel_rename.message.app_error"), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
+ } else if len(message) > model.CHANNEL_NAME_UI_MAX_LENGTH {
+ return &model.CommandResponse{Text: args.T("api.command_channel_rename.too_long.app_error", map[string]interface{}{"Length": len(message)}), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
+ } else if len(message) < model.CHANNEL_NAME_MIN_LENGTH {
+ return &model.CommandResponse{Text: args.T("api.command_channel_rename.too_short.app_error", map[string]interface{}{"Length": len(message)}), ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
patch := &model.ChannelPatch{