mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 22:01:19 +00:00
Migrate apub block activity to standard endTime
property (fixes #2316)
This commit is contained in:
parent
0e7080337b
commit
83a8bb1630
3 changed files with 5 additions and 2 deletions
|
@ -72,6 +72,7 @@ impl BlockUser {
|
||||||
)?,
|
)?,
|
||||||
audience,
|
audience,
|
||||||
expires,
|
expires,
|
||||||
|
end_time: expires,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +150,7 @@ impl ActivityHandler for BlockUser {
|
||||||
#[tracing::instrument(skip_all)]
|
#[tracing::instrument(skip_all)]
|
||||||
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
|
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
|
||||||
insert_received_activity(&self.id, context).await?;
|
insert_received_activity(&self.id, context).await?;
|
||||||
let expires = self.expires.map(Into::into);
|
let expires = self.expires.or(self.end_time).map(Into::into);
|
||||||
let mod_person = self.actor.dereference(context).await?;
|
let mod_person = self.actor.dereference(context).await?;
|
||||||
let blocked_person = self.object.dereference(context).await?;
|
let blocked_person = self.object.dereference(context).await?;
|
||||||
let target = self.target.dereference(context).await?;
|
let target = self.target.dereference(context).await?;
|
||||||
|
|
|
@ -98,7 +98,7 @@ impl ActivityHandler for UndoBlockUser {
|
||||||
#[tracing::instrument(skip_all)]
|
#[tracing::instrument(skip_all)]
|
||||||
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
|
async fn receive(self, context: &Data<LemmyContext>) -> Result<(), LemmyError> {
|
||||||
insert_received_activity(&self.id, context).await?;
|
insert_received_activity(&self.id, context).await?;
|
||||||
let expires = self.object.expires.map(Into::into);
|
let expires = self.object.expires.or(self.object.end_time).map(Into::into);
|
||||||
let mod_person = self.actor.dereference(context).await?;
|
let mod_person = self.actor.dereference(context).await?;
|
||||||
let blocked_person = self.object.object.dereference(context).await?;
|
let blocked_person = self.object.object.dereference(context).await?;
|
||||||
match self.object.target.dereference(context).await? {
|
match self.object.target.dereference(context).await? {
|
||||||
|
|
|
@ -38,7 +38,9 @@ pub struct BlockUser {
|
||||||
pub(crate) remove_data: Option<bool>,
|
pub(crate) remove_data: Option<bool>,
|
||||||
/// block reason, written to mod log
|
/// block reason, written to mod log
|
||||||
pub(crate) summary: Option<String>,
|
pub(crate) summary: Option<String>,
|
||||||
|
/// deprecated
|
||||||
pub(crate) expires: Option<DateTime<Utc>>,
|
pub(crate) expires: Option<DateTime<Utc>>,
|
||||||
|
pub(crate) end_time: Option<DateTime<Utc>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[async_trait::async_trait]
|
#[async_trait::async_trait]
|
||||||
|
|
Loading…
Reference in a new issue