From 53509174b1b09fa1cd0e83f689ca5240c231c087 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Tue, 3 Jan 2017 14:50:53 +0000 Subject: PLT-5018 Fix thumbnails of imported attachments. (#4934) --- api/import.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'api') diff --git a/api/import.go b/api/import.go index 63dfb033d..8681e74c8 100644 --- a/api/import.go +++ b/api/import.go @@ -35,6 +35,12 @@ func ImportPost(post *model.Post) { l4g.Debug(utils.T("api.import.import_post.saving.debug"), post.UserId, post.Message) } + for _, fileId := range post.FileIds { + if result := <-Srv.Store.FileInfo().AttachToPost(fileId, post.Id); result.Err != nil { + l4g.Error(utils.T("api.import.import_post.attach_files.error"), post.Id, post.FileIds, result.Err) + } + } + post.Id = "" post.CreateAt++ post.Message = remainder -- cgit v1.2.3-1-g7c22