Mark objects as not deleted when received via apub (fixes #2507) (#2528)

This commit is contained in:
Nutomic 2022-11-03 13:39:30 +00:00 committed by GitHub
parent cb753b045f
commit b5cd732372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -202,7 +202,7 @@ impl ApubObject for ApubComment {
removed: None, removed: None,
published: note.published.map(|u| u.naive_local()), published: note.published.map(|u| u.naive_local()),
updated: note.updated.map(|u| u.naive_local()), updated: note.updated.map(|u| u.naive_local()),
deleted: None, deleted: Some(false),
ap_id: Some(note.id.into()), ap_id: Some(note.id.into()),
distinguished: note.distinguished, distinguished: note.distinguished,
local: Some(false), local: Some(false),

View file

@ -160,7 +160,7 @@ impl ApubObject for ApubPerson {
display_name: person.name, display_name: person.name,
banned: None, banned: None,
ban_expires: None, ban_expires: None,
deleted: None, deleted: Some(false),
avatar: person.icon.map(|i| i.url.into()), avatar: person.icon.map(|i| i.url.into()),
banner: person.image.map(|i| i.url.into()), banner: person.image.map(|i| i.url.into()),
published: person.published.map(|u| u.naive_local()), published: person.published.map(|u| u.naive_local()),

View file

@ -217,7 +217,7 @@ impl ApubObject for ApubPost {
locked: page.comments_enabled.map(|e| !e), locked: page.comments_enabled.map(|e| !e),
published: page.published.map(|u| u.naive_local()), published: page.published.map(|u| u.naive_local()),
updated: page.updated.map(|u| u.naive_local()), updated: page.updated.map(|u| u.naive_local()),
deleted: None, deleted: Some(false),
nsfw: page.sensitive, nsfw: page.sensitive,
stickied: page.stickied, stickied: page.stickied,
embed_title, embed_title,

View file

@ -149,7 +149,7 @@ impl ApubObject for ApubPrivateMessage {
content: read_from_string_or_source(&note.content, &None, &note.source), content: read_from_string_or_source(&note.content, &None, &note.source),
published: note.published.map(|u| u.naive_local()), published: note.published.map(|u| u.naive_local()),
updated: note.updated.map(|u| u.naive_local()), updated: note.updated.map(|u| u.naive_local()),
deleted: None, deleted: Some(false),
read: None, read: None,
ap_id: Some(note.id.into()), ap_id: Some(note.id.into()),
local: Some(false), local: Some(false),

View file

@ -102,7 +102,7 @@ impl Group {
removed: None, removed: None,
published: self.published.map(|u| u.naive_local()), published: self.published.map(|u| u.naive_local()),
updated: self.updated.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)), nsfw: Some(self.sensitive.unwrap_or(false)),
actor_id: Some(self.id.into()), actor_id: Some(self.id.into()),
local: Some(false), local: Some(false),