From 7fc469fa96e69244c6b5e8b864c82c67d2043de2 Mon Sep 17 00:00:00 2001 From: Bat Date: Tue, 19 Jun 2018 10:50:01 +0100 Subject: [PATCH] Delete reshares when receiving the corresponding Undo activity --- src/activity_pub/inbox.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/activity_pub/inbox.rs b/src/activity_pub/inbox.rs index 1d8fe0a6..a20af1ea 100644 --- a/src/activity_pub/inbox.rs +++ b/src/activity_pub/inbox.rs @@ -1,6 +1,6 @@ use activitypub::{ Object, - activity::{Create, Like, Undo} + activity::{Announce, Create, Like, Undo} }; use diesel::PgConnection; use failure::Error; @@ -90,6 +90,10 @@ pub trait Inbox { likes::Like::delete_activity(conn, Id::new(act.undo_props.object_object::()?.object_props.id_string()?)); Ok(()) }, + "Announce" => { + Reshare::delete_activity(conn, Id::new(act.undo_props.object_object::()?.object_props.id_string()?)); + Ok(()) + } _ => Err(InboxError::CantUndo)? } }