summaryrefslogtreecommitdiffstats
path: root/app/webhook.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-09 13:30:48 -0400
committerChris <ccbrown112@gmail.com>2017-10-09 10:30:48 -0700
commit9adaf53e110e0e806b21903111aacb93129668cb (patch)
treeedea5dfe0b71945142898840d0485adb57750b31 /app/webhook.go
parent0da0cf1a21d7dea61f4459ee71bf01b6ca362aee (diff)
downloadchat-9adaf53e110e0e806b21903111aacb93129668cb.tar.gz
chat-9adaf53e110e0e806b21903111aacb93129668cb.tar.bz2
chat-9adaf53e110e0e806b21903111aacb93129668cb.zip
PLT-7818 Updates to post type (#7579)
* Updates to post type * Update tests
Diffstat (limited to 'app/webhook.go')
-rw-r--r--app/webhook.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/webhook.go b/app/webhook.go
index 9d9b24b10..1530ba94a 100644
--- a/app/webhook.go
+++ b/app/webhook.go
@@ -131,6 +131,11 @@ func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, ove
post := &model.Post{UserId: userId, ChannelId: channel.Id, Message: text, Type: postType}
post.AddProp("from_webhook", "true")
+ if strings.HasPrefix(post.Type, model.POST_SYSTEM_MESSAGE_PREFIX) {
+ err := model.NewAppError("CreateWebhookPost", "api.context.invalid_param.app_error", map[string]interface{}{"Name": "post.type"}, "", http.StatusBadRequest)
+ return nil, err
+ }
+
if metrics := a.Metrics; metrics != nil {
metrics.IncrementWebhookPost()
}