diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-30 10:56:20 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-04 09:45:02 -0400 |
commit | 441156b91e9f9bac6b5592616551e2920c4cb33b (patch) | |
tree | 64e0c2e8a1329a0b761883fd47c3b588d11a69af /model/command.go | |
parent | 785553384fe96027b0e9274b6ccc8623092eda70 (diff) | |
download | chat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.gz chat-441156b91e9f9bac6b5592616551e2920c4cb33b.tar.bz2 chat-441156b91e9f9bac6b5592616551e2920c4cb33b.zip |
Added DisplayName and Description fields to both types of webhooks and slash commands
Diffstat (limited to 'model/command.go')
-rw-r--r-- | model/command.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/model/command.go b/model/command.go index 56d88f13c..ca3038122 100644 --- a/model/command.go +++ b/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"` } @@ -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 } |