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.
This commit is contained in:
parent
5a0a3ce451
commit
4af9fa66aa
1 changed files with 3 additions and 1 deletions
4
posts.go
4
posts.go
|
@ -871,7 +871,9 @@ func addPost(app *app, w http.ResponseWriter, r *http.Request) error {
|
||||||
if pRes.Code != http.StatusOK {
|
if pRes.Code != http.StatusOK {
|
||||||
continue
|
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)
|
return impart.WriteSuccess(w, res, http.StatusOK)
|
||||||
|
|
Loading…
Add table
Reference in a new issue