From 3b00532174248a22d6119bfb2f3cb9a5d0a07125 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 21 Dec 2021 16:24:22 -0500 Subject: [PATCH] Adding ban_expires to person --- crates/apub/src/objects/person.rs | 3 ++- crates/apub/src/protocol/objects/person.rs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/apub/src/objects/person.rs b/crates/apub/src/objects/person.rs index d4ac7abb3..8e3c7a34d 100644 --- a/crates/apub/src/objects/person.rs +++ b/crates/apub/src/objects/person.rs @@ -113,6 +113,7 @@ impl ApubObject for ApubPerson { updated: self.updated.map(convert_datetime), unparsed: Default::default(), inbox: self.inbox_url.clone().into(), + ban_expires: self.ban_expires.map(convert_datetime), }; Ok(person) } @@ -168,7 +169,7 @@ impl ApubObject for ApubPerson { inbox_url: Some(person.inbox.into()), shared_inbox_url: Some(person.endpoints.shared_inbox.map(|s| s.into())), matrix_user_id: Some(person.matrix_user_id), - ban_expires: None, + ban_expires: Some(person.ban_expires.map(|u| u.naive_local())), }; let person = blocking(context.pool(), move |conn| { DbPerson::upsert(conn, &person_form) diff --git a/crates/apub/src/protocol/objects/person.rs b/crates/apub/src/protocol/objects/person.rs index f66b09aa0..c8d4dce26 100644 --- a/crates/apub/src/protocol/objects/person.rs +++ b/crates/apub/src/protocol/objects/person.rs @@ -39,6 +39,7 @@ pub struct Person { pub(crate) public_key: PublicKey, pub(crate) published: Option>, pub(crate) updated: Option>, + pub(crate) ban_expires: Option>, #[serde(flatten)] pub(crate) unparsed: Unparsed, }