PLT-7818 Updates to post type (#7579)
* Updates to post type * Update tests
Этот коммит содержится в:
коммит произвёл
Chris
родитель
0da0cf1a21
Коммит
9adaf53e11
@@ -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()
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user