From a8e9b5498adb34c8bacd4f794c6cd5778a18a8e5 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 18 Jun 2018 23:57:53 +0200 Subject: [PATCH] Fix Delete side effects --- activitypub.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/activitypub.py b/activitypub.py index 7a929c4..21edb4c 100644 --- a/activitypub.py +++ b/activitypub.py @@ -241,12 +241,14 @@ class MicroblogPubBackend(Backend): ) obj = delete.get_object() if obj.ACTIVITY_TYPE != ap.ActivityType.NOTE: - obj = DB.inbox.find_one( - { - "activity.object.id": delete.get_object().id, - "type": ap.ActivityType.CREATE.value, - } - ) + obj = ap.parse_activity( + DB.inbox.find_one( + { + "activity.object.id": delete.get_object().id, + "type": ap.ActivityType.CREATE.value, + } + )["activity"] + ).get_object() logger.info(f"inbox_delete handle_replies obj={obj!r}") if obj: @@ -273,7 +275,7 @@ class MicroblogPubBackend(Backend): "activity.object.id": delete.get_object().id, "type": ap.ActivityType.CREATE.value, } - ) + )["activity"] ).get_object() self._handle_replies_delete(as_actor, obj)