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/incoming_webhook.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'model/incoming_webhook.go') diff --git a/model/incoming_webhook.go b/model/incoming_webhook.go index 8432f5fea..0763b443e 100644 --- a/model/incoming_webhook.go +++ b/model/incoming_webhook.go @@ -14,13 +14,15 @@ const ( ) type IncomingWebhook struct { - Id string `json:"id"` - CreateAt int64 `json:"create_at"` - UpdateAt int64 `json:"update_at"` - DeleteAt int64 `json:"delete_at"` - UserId string `json:"user_id"` - ChannelId string `json:"channel_id"` - TeamId string `json:"team_id"` + Id string `json:"id"` + CreateAt int64 `json:"create_at"` + UpdateAt int64 `json:"update_at"` + DeleteAt int64 `json:"delete_at"` + UserId string `json:"user_id"` + ChannelId string `json:"channel_id"` + TeamId string `json:"team_id"` + DisplayName string `json:"display_name"` + Description string `json:"description"` } type IncomingWebhookRequest struct { @@ -99,6 +101,14 @@ func (o *IncomingWebhook) IsValid() *AppError { return NewLocAppError("IncomingWebhook.IsValid", "model.incoming_hook.team_id.app_error", nil, "") } + if len(o.DisplayName) > 64 { + return NewLocAppError("IncomingWebhook.IsValid", "model.incoming_hook.display_name.app_error", nil, "") + } + + if len(o.Description) > 128 { + return NewLocAppError("IncomingWebhook.IsValid", "model.incoming_hook.description.app_error", nil, "") + } + return nil } -- cgit v1.2.3-1-g7c22