summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/platform/model/command.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-05-15 23:02:30 +0200
committerWim <wim@42.be>2016-05-15 23:02:30 +0200
commit59e6abcc11ed3a3548ffb02d1e455485672d8308 (patch)
treea5086741b8595d7eb33a0f41e7c109d064be33ef /vendor/github.com/mattermost/platform/model/command.go
parent38e3bbe5c96eb84f3e223c44f801ee7e3308b2c1 (diff)
downloadmatterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.tar.gz
matterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.tar.bz2
matterbridge-msglm-59e6abcc11ed3a3548ffb02d1e455485672d8308.zip
Sync with mattermost 3.0
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/command.go')
-rw-r--r--vendor/github.com/mattermost/platform/model/command.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/github.com/mattermost/platform/model/command.go b/vendor/github.com/mattermost/platform/model/command.go
index 56d88f13..4d5f7ace 100644
--- a/vendor/github.com/mattermost/platform/model/command.go
+++ b/vendor/github.com/mattermost/platform/model/command.go
@@ -29,6 +29,7 @@ type Command struct {
AutoCompleteDesc string `json:"auto_complete_desc"`
AutoCompleteHint string `json:"auto_complete_hint"`
DisplayName string `json:"display_name"`
+ Description string `json:"description"`
URL string `json:"url"`
}
@@ -98,7 +99,7 @@ func (o *Command) IsValid() *AppError {
return NewLocAppError("Command.IsValid", "model.command.is_valid.team_id.app_error", nil, "")
}
- if len(o.Trigger) > 1024 {
+ if len(o.Trigger) == 0 || len(o.Trigger) > 128 {
return NewLocAppError("Command.IsValid", "model.command.is_valid.trigger.app_error", nil, "")
}
@@ -114,6 +115,14 @@ func (o *Command) IsValid() *AppError {
return NewLocAppError("Command.IsValid", "model.command.is_valid.method.app_error", nil, "")
}
+ if len(o.DisplayName) > 64 {
+ return NewLocAppError("Command.IsValid", "model.command.is_valid.display_name.app_error", nil, "")
+ }
+
+ if len(o.Description) > 128 {
+ return NewLocAppError("Command.IsValid", "model.command.is_valid.description.app_error", nil, "")
+ }
+
return nil
}