]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/create_or_update/comment.rs
When announcing incoming activities, keep extra fields (#2550)
[lemmy.git] / crates / apub / src / protocol / activities / create_or_update / comment.rs
1 use crate::{
2   mentions::MentionOrValue,
3   objects::person::ApubPerson,
4   protocol::{activities::CreateOrUpdateType, objects::note::Note},
5 };
6 use activitypub_federation::{core::object_id::ObjectId, deser::helpers::deserialize_one_or_many};
7 use serde::{Deserialize, Serialize};
8 use url::Url;
9
10 #[derive(Clone, Debug, Deserialize, Serialize)]
11 #[serde(rename_all = "camelCase")]
12 pub struct CreateOrUpdateComment {
13   pub(crate) actor: ObjectId<ApubPerson>,
14   #[serde(deserialize_with = "deserialize_one_or_many")]
15   pub(crate) to: Vec<Url>,
16   pub(crate) object: Note,
17   #[serde(deserialize_with = "deserialize_one_or_many")]
18   pub(crate) cc: Vec<Url>,
19   #[serde(default)]
20   pub(crate) tag: Vec<MentionOrValue>,
21   #[serde(rename = "type")]
22   pub(crate) kind: CreateOrUpdateType,
23   pub(crate) id: Url,
24 }