From 441156b91e9f9bac6b5592616551e2920c4cb33b Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Wed, 30 Mar 2016 10:56:20 -0400 Subject: Added DisplayName and Description fields to both types of webhooks and slash commands --- model/command.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'model/command.go') 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 } -- cgit v1.2.3-1-g7c22