1 use crate::{activities::block::SiteOrCommunity, objects::person::ApubPerson, protocol::Unparsed};
2 use activitystreams_kinds::activity::BlockType;
3 use chrono::{DateTime, FixedOffset};
4 use lemmy_apub_lib::object_id::ObjectId;
5 use serde::{Deserialize, Serialize};
8 #[derive(Clone, Debug, Deserialize, Serialize)]
9 #[serde(rename_all = "camelCase")]
10 pub struct BlockUser {
11 pub(crate) actor: ObjectId<ApubPerson>,
12 #[serde(deserialize_with = "crate::deserialize_one_or_many")]
13 pub(crate) to: Vec<Url>,
14 pub(crate) object: ObjectId<ApubPerson>,
15 #[serde(deserialize_with = "crate::deserialize_one_or_many")]
16 pub(crate) cc: Vec<Url>,
17 pub(crate) target: ObjectId<SiteOrCommunity>,
18 #[serde(rename = "type")]
19 pub(crate) kind: BlockType,
22 /// Quick and dirty solution.
23 /// TODO: send a separate Delete activity instead
24 pub(crate) remove_data: Option<bool>,
25 /// block reason, written to mod log
26 pub(crate) summary: Option<String>,
27 pub(crate) expires: Option<DateTime<FixedOffset>>,
29 pub(crate) unparsed: Unparsed,