]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/deletion/delete_user.rs
add enable_federated_downvotes site option
[lemmy.git] / crates / apub / src / protocol / activities / deletion / delete_user.rs
1 use crate::objects::person::ApubPerson;
2 use activitypub_federation::{
3   fetch::object_id::ObjectId,
4   kinds::activity::DeleteType,
5   protocol::helpers::deserialize_one_or_many,
6 };
7 use serde::{Deserialize, Serialize};
8 use serde_with::skip_serializing_none;
9 use url::Url;
10
11 #[skip_serializing_none]
12 #[derive(Clone, Debug, Deserialize, Serialize)]
13 #[serde(rename_all = "camelCase")]
14 pub struct DeleteUser {
15   pub(crate) actor: ObjectId<ApubPerson>,
16   #[serde(deserialize_with = "deserialize_one_or_many")]
17   pub(crate) to: Vec<Url>,
18   pub(crate) object: ObjectId<ApubPerson>,
19   #[serde(rename = "type")]
20   pub(crate) kind: DeleteType,
21   pub(crate) id: Url,
22
23   #[serde(deserialize_with = "deserialize_one_or_many", default)]
24   #[serde(skip_serializing_if = "Vec::is_empty")]
25   pub(crate) cc: Vec<Url>,
26 }