Don't federate scheduled posts upon claiming

Previously, moving an anonymous post to a blog would instantly federate
the post, regardless of its `created` date. This now respects that value
and doesn't federate the post if its `created` date is in the future.

This is the first part of supporting scheduled, federated posts (ref T567)
but technically fixes #76.
pull/95/head
Matt Baer 6 years ago
parent 5a0a3ce451
commit 4af9fa66aa
  1. 4
      posts.go

@ -871,7 +871,9 @@ func addPost(app *app, w http.ResponseWriter, r *http.Request) error {
if pRes.Code != http.StatusOK {
continue
}
go federatePost(app, pRes.Post, pRes.Post.Collection.ID, false)
if !pRes.Post.Created.After(time.Now()) {
go federatePost(app, pRes.Post, pRes.Post.Collection.ID, false)
}
}
}
return impart.WriteSuccess(w, res, http.StatusOK)

Loading…
Cancel
Save