diff --git a/app/post.go b/app/post.go index c45c5fd8d7..7be53bc516 100644 --- a/app/post.go +++ b/app/post.go @@ -266,6 +266,11 @@ func (a *App) CreatePost(c *request.Context, post *model.Post, channel *model.Ch } } + // Pre-fill the CreateAt field for link previews to get the correct timestamp. + if post.CreateAt == 0 { + post.CreateAt = model.GetMillis() + } + post = a.getEmbedsAndImages(post, true) previewPost := post.GetPreviewPost() if previewPost != nil {