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