mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-02-10 02:54:49 +00:00
28 lines
1 KiB
Rust
28 lines
1 KiB
Rust
use crate::{activities::block::SiteOrCommunity, objects::person::ApubPerson};
|
|
use activitypub_federation::{core::object_id::ObjectId, deser::helpers::deserialize_one_or_many};
|
|
use activitystreams_kinds::activity::BlockType;
|
|
use chrono::{DateTime, FixedOffset};
|
|
use serde::{Deserialize, Serialize};
|
|
use url::Url;
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
#[serde(rename_all = "camelCase")]
|
|
pub struct BlockUser {
|
|
pub(crate) actor: ObjectId<ApubPerson>,
|
|
#[serde(deserialize_with = "deserialize_one_or_many")]
|
|
pub(crate) to: Vec<Url>,
|
|
pub(crate) object: ObjectId<ApubPerson>,
|
|
#[serde(deserialize_with = "deserialize_one_or_many")]
|
|
pub(crate) cc: Vec<Url>,
|
|
pub(crate) target: ObjectId<SiteOrCommunity>,
|
|
#[serde(rename = "type")]
|
|
pub(crate) kind: BlockType,
|
|
pub(crate) id: Url,
|
|
|
|
/// Quick and dirty solution.
|
|
/// TODO: send a separate Delete activity instead
|
|
pub(crate) remove_data: Option<bool>,
|
|
/// block reason, written to mod log
|
|
pub(crate) summary: Option<String>,
|
|
pub(crate) expires: Option<DateTime<FixedOffset>>,
|
|
}
|