Add missing published field to Announce

This commit is contained in:
Rafael Caricio 2023-08-07 19:24:13 +02:00
parent 89938a7c53
commit 2d2f3f9040
Signed by: rafaelcaricio
GPG key ID: 3C86DBCE8E93C947

View file

@ -174,6 +174,7 @@ pub fn spawn(
};
let mut seen_actors = HashSet::new();
let mut seen_inboxes = HashSet::new();
let published = chrono::Utc::now().to_rfc3339_opts(chrono::SecondsFormat::Secs, true);
for actor in post.relay_targets(hostname.clone()) {
if seen_actors.contains(&actor) {
continue;
@ -185,6 +186,7 @@ pub fn spawn(
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Announce",
"actor": *actor_id,
"published": &published,
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"object": &post.uri,
"id": announce_id,