summaryrefslogtreecommitdiffstats
path: root/model/outgoing_webhook.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-30 10:56:20 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-04-04 09:45:02 -0400
commit441156b91e9f9bac6b5592616551e2920c4cb33b (patch)
tree64e0c2e8a1329a0b761883fd47c3b588d11a69af /model/outgoing_webhook.go
parent785553384fe96027b0e9274b6ccc8623092eda70 (diff)
downloadchat-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/outgoing_webhook.go')
-rw-r--r--model/outgoing_webhook.go10
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
}