Adding ban_expires to person

temp_bans
Dessalines 2021-12-21 16:24:22 -05:00
parent 3b54acb479
commit 3b00532174
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -39,6 +39,7 @@ pub struct Person {
pub(crate) public_key: PublicKey,
pub(crate) published: Option<DateTime<FixedOffset>>,
pub(crate) updated: Option<DateTime<FixedOffset>>,
pub(crate) ban_expires: Option<DateTime<FixedOffset>>,
#[serde(flatten)]
pub(crate) unparsed: Unparsed,
}