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/outgoing_webhook.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'model/outgoing_webhook.go') diff --git a/model/outgoing_webhook.go b/model/outgoing_webhook.go index 70de4d26e..e13de9080 100644 --- a/model/outgoing_webhook.go +++ b/model/outgoing_webhook.go @@ -20,6 +20,8 @@ type OutgoingWebhook struct { TeamId string `json:"team_id"` TriggerWords StringArray `json:"trigger_words"` CallbackURLs StringArray `json:"callback_urls"` + DisplayName string `json:"display_name"` + Description string `json:"description"` } func (o *OutgoingWebhook) ToJson() string { @@ -106,6 +108,14 @@ func (o *OutgoingWebhook) IsValid() *AppError { } } + if len(o.DisplayName) > 64 { + return NewLocAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.display_name.app_error", nil, "") + } + + if len(o.Description) > 128 { + return NewLocAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.description.app_error", nil, "") + } + return nil } -- cgit v1.2.3-1-g7c22