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