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 удалений

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

@@ -67,7 +67,9 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) {
c.App.UpdateLastActivityAtIfNeeded(c.Session)
w.WriteHeader(http.StatusCreated)
w.Write([]byte(c.App.PreparePostForClient(rp).ToJson()))
// Note that rp has already had PreparePostForClient called on it by App.CreatePost
w.Write([]byte(rp.ToJson()))
}
func createEphemeralPost(c *Context, w http.ResponseWriter, r *http.Request) {