2 objects::person::ApubPerson,
3 protocol::{objects::Endpoints, ImageObject, Source},
5 use activitypub_federation::{
6 core::{object_id::ObjectId, signatures::PublicKey},
7 deser::helpers::deserialize_skip_error,
9 use chrono::{DateTime, FixedOffset};
10 use serde::{Deserialize, Serialize};
11 use serde_with::skip_serializing_none;
14 #[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Eq)]
21 #[skip_serializing_none]
22 #[derive(Clone, Debug, Deserialize, Serialize)]
23 #[serde(rename_all = "camelCase")]
25 #[serde(rename = "type")]
26 pub(crate) kind: UserTypes,
27 pub(crate) id: ObjectId<ApubPerson>,
28 /// username, set at account creation and usually fixed after that
29 pub(crate) preferred_username: String,
30 pub(crate) inbox: Url,
31 /// mandatory field in activitypub, lemmy currently serves an empty outbox
32 pub(crate) outbox: Url,
33 pub(crate) public_key: PublicKey,
36 pub(crate) name: Option<String>,
37 pub(crate) summary: Option<String>,
38 #[serde(deserialize_with = "deserialize_skip_error", default)]
39 pub(crate) source: Option<Source>,
41 pub(crate) icon: Option<ImageObject>,
43 pub(crate) image: Option<ImageObject>,
44 pub(crate) matrix_user_id: Option<String>,
45 pub(crate) endpoints: Option<Endpoints>,
46 pub(crate) published: Option<DateTime<FixedOffset>>,
47 pub(crate) updated: Option<DateTime<FixedOffset>>,