]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/following/undo_follow.rs
add enable_federated_downvotes site option
[lemmy.git] / crates / apub / src / protocol / activities / following / undo_follow.rs
1 use crate::{objects::person::ApubPerson, protocol::activities::following::follow::Follow};
2 use activitypub_federation::{
3   fetch::object_id::ObjectId,
4   kinds::activity::UndoType,
5   protocol::helpers::deserialize_skip_error,
6 };
7 use serde::{Deserialize, Serialize};
8 use url::Url;
9
10 #[derive(Clone, Debug, Deserialize, Serialize)]
11 #[serde(rename_all = "camelCase")]
12 pub struct UndoFollow {
13   pub(crate) actor: ObjectId<ApubPerson>,
14   /// Optional, for compatibility with platforms that always expect recipient field
15   #[serde(deserialize_with = "deserialize_skip_error", default)]
16   pub(crate) to: Option<[ObjectId<ApubPerson>; 1]>,
17   pub(crate) object: Follow,
18   #[serde(rename = "type")]
19   pub(crate) kind: UndoType,
20   pub(crate) id: Url,
21 }