diff options
author | Corey Hulen <corey@hulen.com> | 2016-04-04 08:15:13 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-04-04 08:15:13 -0700 |
commit | 578749d08315945020fcf4466a6f0709a128dbbf (patch) | |
tree | 190561a505b5f51bafd570c2c8c48196761a49e0 /model/outgoing_webhook.go | |
parent | ead8e64ccb42081272bca1a498a08c05825ce9d0 (diff) | |
parent | 74daec08ce7f1b6a09e4b364f45b0f05f3c28a9e (diff) | |
download | chat-578749d08315945020fcf4466a6f0709a128dbbf.tar.gz chat-578749d08315945020fcf4466a6f0709a128dbbf.tar.bz2 chat-578749d08315945020fcf4466a6f0709a128dbbf.zip |
Merge pull request #2584 from hmhealey/plt2054
PLT-2054 Add DisplayName and Description fields for integrations
Diffstat (limited to 'model/outgoing_webhook.go')
-rw-r--r-- | model/outgoing_webhook.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 } |