MM-11434 Only call PreparePostForClient once when creating a post (#9868) (#9876)

* MM-11434 Only call PreparePostForClient once when creating a post

* Have PreparePostForClient provide new metadata when a post already has it and update tests
Этот коммит содержится в:
Harrison Healey
2018-11-23 10:20:02 -05:00
коммит произвёл GitHub
родитель d76069cdbd
Коммит d018554ef3
5 изменённых файлов: 44 добавлений и 39 удалений

Просмотреть файл

@@ -318,7 +318,10 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
}
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POSTED, "", post.ChannelId, "", nil)
message.Add("post", a.PreparePostForClient(post).ToJson())
// Note that PreparePostForClient should've already been called by this point
message.Add("post", post.ToJson())
message.Add("channel_type", channel.Type)
message.Add("channel_display_name", notification.GetChannelName(model.SHOW_USERNAME, ""))
message.Add("channel_name", channel.Name)