]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/create_or_update/private_message.rs
Reorganize federation tests (#2092)
[lemmy.git] / crates / apub / src / protocol / activities / create_or_update / private_message.rs
1 use crate::{
2   objects::person::ApubPerson,
3   protocol::{activities::CreateOrUpdateType, objects::chat_message::ChatMessage, Unparsed},
4 };
5 use lemmy_apub_lib::object_id::ObjectId;
6 use serde::{Deserialize, Serialize};
7 use url::Url;
8
9 #[derive(Clone, Debug, Deserialize, Serialize)]
10 #[serde(rename_all = "camelCase")]
11 pub struct CreateOrUpdatePrivateMessage {
12   pub(crate) id: Url,
13   pub(crate) actor: ObjectId<ApubPerson>,
14   #[serde(deserialize_with = "crate::deserialize_one")]
15   pub(crate) to: [ObjectId<ApubPerson>; 1],
16   pub(crate) object: ChatMessage,
17   #[serde(rename = "type")]
18   pub(crate) kind: CreateOrUpdateType,
19
20   #[serde(flatten)]
21   pub(crate) unparsed: Unparsed,
22 }