-#[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq)]
-pub enum UserTypes {
- Person,
- Service,
-}
-
-#[skip_serializing_none]
-#[derive(Clone, Debug, Deserialize, Serialize)]
-#[serde(rename_all = "camelCase")]
-pub struct Person {
- #[serde(rename = "type")]
- kind: UserTypes,
- id: Url,
- /// username, set at account creation and can never be changed
- preferred_username: String,
- /// displayname (can be changed at any time)
- name: Option<String>,
- summary: Option<String>,
- source: Option<Source>,
- /// user avatar
- icon: Option<ImageObject>,
- /// user banner
- image: Option<ImageObject>,
- matrix_user_id: Option<String>,
- inbox: Url,
- /// mandatory field in activitypub, currently empty in lemmy
- outbox: Url,
- endpoints: Endpoints<Url>,
- public_key: PublicKey,
- published: Option<DateTime<FixedOffset>>,
- updated: Option<DateTime<FixedOffset>>,
- #[serde(flatten)]
- unparsed: Unparsed,
-}
-
-// TODO: can generate this with a derive macro
-impl Person {
- pub(crate) fn id(&self, expected_domain: &Url) -> Result<&Url, LemmyError> {
- verify_domains_match(&self.id, expected_domain)?;
- Ok(&self.id)
- }
-}
-
-#[derive(Clone, Debug, PartialEq)]
-pub struct ApubPerson(DbPerson);