9304 added the attachments import to direct post (#9308)

Этот коммит содержится в:
Pradeep Murugesan
2018-08-29 14:27:44 +02:00
коммит произвёл Carlos Tadeu Panato Junior
родитель c2676d964e
Коммит 7a3cf112c5
3 изменённых файлов: 64 добавлений и 3 удалений

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

@@ -1118,6 +1118,14 @@ func (a *App) ImportDirectPost(data *DirectPostImportData, dryRun bool) *model.A
post.Hashtags, _ = model.ParseHashtags(post.Message)
if data.Attachments != nil {
fileIds, err := a.uploadAttachments(data.Attachments, post, "noteam", dryRun)
if err != nil {
return err
}
post.FileIds = append(post.FileIds, fileIds...)
}
if post.Id == "" {
if result := <-a.Srv.Store.Post().Save(post); result.Err != nil {
return result.Err
@@ -1171,6 +1179,7 @@ func (a *App) ImportDirectPost(data *DirectPostImportData, dryRun bool) *model.A
}
}
a.UpdateFileInfoWithPostId(post)
return nil
}