summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-01-03 14:50:53 +0000
committerenahum <nahumhbl@gmail.com>2017-01-03 11:50:53 -0300
commit53509174b1b09fa1cd0e83f689ca5240c231c087 (patch)
treee67292b72e412dbb2d1dc0c3e1e79e2031f776b0 /api
parent4ccfbbdcf15d020e0a269ba172226c5285a9e7eb (diff)
downloadchat-53509174b1b09fa1cd0e83f689ca5240c231c087.tar.gz
chat-53509174b1b09fa1cd0e83f689ca5240c231c087.tar.bz2
chat-53509174b1b09fa1cd0e83f689ca5240c231c087.zip
PLT-5018 Fix thumbnails of imported attachments. (#4934)
Diffstat (limited to 'api')
-rw-r--r--api/import.go6
1 files changed, 6 insertions, 0 deletions
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