Merge pull request #8 from rafaelcaricio/add-published-field

Add missing `published` field to Announce
This commit is contained in:
Astro 2023-08-07 19:51:32 +02:00 committed by GitHub
commit 83f6679209
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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