]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/community/update.rs
Reorganize federation tests (#2092)
[lemmy.git] / crates / apub / src / protocol / activities / community / update.rs
1 use crate::{
2   objects::person::ApubPerson,
3   protocol::{objects::group::Group, Unparsed},
4 };
5 use activitystreams_kinds::activity::UpdateType;
6 use lemmy_apub_lib::object_id::ObjectId;
7 use serde::{Deserialize, Serialize};
8 use url::Url;
9
10 /// This activity is received from a remote community mod, and updates the description or other
11 /// fields of a local community.
12 #[derive(Clone, Debug, Deserialize, Serialize)]
13 #[serde(rename_all = "camelCase")]
14 pub struct UpdateCommunity {
15   pub(crate) actor: ObjectId<ApubPerson>,
16   #[serde(deserialize_with = "crate::deserialize_one_or_many")]
17   pub(crate) to: Vec<Url>,
18   // TODO: would be nice to use a separate struct here, which only contains the fields updated here
19   pub(crate) object: Box<Group>,
20   #[serde(deserialize_with = "crate::deserialize_one_or_many")]
21   pub(crate) cc: Vec<Url>,
22   #[serde(rename = "type")]
23   pub(crate) kind: UpdateType,
24   pub(crate) id: Url,
25
26   #[serde(flatten)]
27   pub(crate) unparsed: Unparsed,
28 }