From: Nutomic Date: Thu, 3 Nov 2022 13:39:30 +0000 (+0000) Subject: Mark objects as not deleted when received via apub (fixes #2507) (#2528) X-Git-Url: http://these/git/%22https:/nerdica.net/photo/contact/80/%24%7Bargs.pageFn.jump%20n%7D?a=commitdiff_plain;h=b5cd732372fa8de089586dd2e8ad4d3c516323d4;p=lemmy.git Mark objects as not deleted when received via apub (fixes #2507) (#2528) --- diff --git a/crates/apub/src/objects/comment.rs b/crates/apub/src/objects/comment.rs index 154bd41c..cca092db 100644 --- a/crates/apub/src/objects/comment.rs +++ b/crates/apub/src/objects/comment.rs @@ -202,7 +202,7 @@ impl ApubObject for ApubComment { removed: None, published: note.published.map(|u| u.naive_local()), updated: note.updated.map(|u| u.naive_local()), - deleted: None, + deleted: Some(false), ap_id: Some(note.id.into()), distinguished: note.distinguished, local: Some(false), diff --git a/crates/apub/src/objects/person.rs b/crates/apub/src/objects/person.rs index e496da07..41d6b777 100644 --- a/crates/apub/src/objects/person.rs +++ b/crates/apub/src/objects/person.rs @@ -160,7 +160,7 @@ impl ApubObject for ApubPerson { display_name: person.name, banned: None, ban_expires: None, - deleted: None, + deleted: Some(false), avatar: person.icon.map(|i| i.url.into()), banner: person.image.map(|i| i.url.into()), published: person.published.map(|u| u.naive_local()), diff --git a/crates/apub/src/objects/post.rs b/crates/apub/src/objects/post.rs index 2f6f628c..ac9b82eb 100644 --- a/crates/apub/src/objects/post.rs +++ b/crates/apub/src/objects/post.rs @@ -217,7 +217,7 @@ impl ApubObject for ApubPost { locked: page.comments_enabled.map(|e| !e), published: page.published.map(|u| u.naive_local()), updated: page.updated.map(|u| u.naive_local()), - deleted: None, + deleted: Some(false), nsfw: page.sensitive, stickied: page.stickied, embed_title, diff --git a/crates/apub/src/objects/private_message.rs b/crates/apub/src/objects/private_message.rs index bdab7dd0..87f88de8 100644 --- a/crates/apub/src/objects/private_message.rs +++ b/crates/apub/src/objects/private_message.rs @@ -149,7 +149,7 @@ impl ApubObject for ApubPrivateMessage { content: read_from_string_or_source(¬e.content, &None, ¬e.source), published: note.published.map(|u| u.naive_local()), updated: note.updated.map(|u| u.naive_local()), - deleted: None, + deleted: Some(false), read: None, ap_id: Some(note.id.into()), local: Some(false), diff --git a/crates/apub/src/protocol/objects/group.rs b/crates/apub/src/protocol/objects/group.rs index 5abfa2b2..7d207da4 100644 --- a/crates/apub/src/protocol/objects/group.rs +++ b/crates/apub/src/protocol/objects/group.rs @@ -102,7 +102,7 @@ impl Group { removed: None, published: self.published.map(|u| u.naive_local()), updated: self.updated.map(|u| u.naive_local()), - deleted: None, + deleted: Some(false), nsfw: Some(self.sensitive.unwrap_or(false)), actor_id: Some(self.id.into()), local: Some(false),