fix: insert undo activities or nuke doesnt work

.............
This commit is contained in:
əlemi 2024-06-24 03:02:13 +02:00
parent 8f65740c14
commit ab1ca489be
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -318,7 +318,7 @@ pub async fn update(ctx: &crate::Context, activity: impl apb::Activity, tx: &Dat
Ok(())
}
pub async fn undo(_ctx: &crate::Context, activity: impl apb::Activity, tx: &DatabaseTransaction) -> Result<(), ProcessorError> {
pub async fn undo(ctx: &crate::Context, activity: impl apb::Activity, tx: &DatabaseTransaction) -> Result<(), ProcessorError> {
// TODO in theory we could work with just object_id but right now only accept embedded
let undone_activity = activity.object()
.extract()
@ -393,6 +393,10 @@ pub async fn undo(_ctx: &crate::Context, activity: impl apb::Activity, tx: &Data
_ => return Err(ProcessorError::Unprocessable(activity.id()?.to_string())),
}
if ctx.is_local(activity.id()?) {
ctx.insert_activity(activity, tx).await?;
}
Ok(())
}