]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/deletion/delete.rs
Support mastodon deletes
[lemmy.git] / crates / apub / src / protocol / activities / deletion / delete.rs
1 use crate::{objects::person::ApubPerson, protocol::objects::tombstone::Tombstone};
2 use activitystreams::{activity::kind::DeleteType, unparsed::Unparsed};
3 use lemmy_apub_lib::object_id::ObjectId;
4 use serde::{Deserialize, Serialize};
5 use serde_with::skip_serializing_none;
6 use url::Url;
7
8 #[skip_serializing_none]
9 #[derive(Clone, Debug, Deserialize, Serialize)]
10 #[serde(rename_all = "camelCase")]
11 pub struct Delete {
12   pub(crate) actor: ObjectId<ApubPerson>,
13   pub(crate) to: Vec<Url>,
14   pub(crate) object: Tombstone,
15   #[serde(rename = "type")]
16   pub(crate) kind: DeleteType,
17   /// If summary is present, this is a mod action (Remove in Lemmy terms). Otherwise, its a user
18   /// deleting their own content.
19   pub(crate) summary: Option<String>,
20   pub(crate) id: Url,
21   #[serde(flatten)]
22   pub(crate) unparsed: Unparsed,
23 }