From 7b6982c959098d9df1a0e6aafb78e28140232d72 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 9 Jul 2018 22:29:03 +0200 Subject: [PATCH] Better Delete handling --- activitypub.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/activitypub.py b/activitypub.py index b30a98c..37b7ef1 100644 --- a/activitypub.py +++ b/activitypub.py @@ -305,6 +305,12 @@ class MicroblogPubBackend(Backend): ).get_object() logger.info(f"inbox_delete handle_replies obj={obj!r}") + + # Fake a Undo so any related Like/Announce doesn't appear on the web UI + DB.activities.update( + {"meta.object.id": obj.id}, + {"$set": {"meta.undo": True, "meta.exta": "object deleted"}}, + ) if obj: self._handle_replies_delete(as_actor, obj) @@ -325,6 +331,11 @@ class MicroblogPubBackend(Backend): )["activity"] ).get_object() + DB.activities.update( + {"meta.object.id": obj.id}, + {"$set": {"meta.undo": True, "meta.exta": "object deleted"}}, + ) + self._handle_replies_delete(as_actor, obj) @ensure_it_is_me