Fix Delete side effects

This commit is contained in:
Thomas Sileo 2018-06-18 23:57:53 +02:00
parent c383259296
commit a8e9b5498a

View file

@ -241,12 +241,14 @@ class MicroblogPubBackend(Backend):
) )
obj = delete.get_object() obj = delete.get_object()
if obj.ACTIVITY_TYPE != ap.ActivityType.NOTE: if obj.ACTIVITY_TYPE != ap.ActivityType.NOTE:
obj = DB.inbox.find_one( obj = ap.parse_activity(
{ DB.inbox.find_one(
"activity.object.id": delete.get_object().id, {
"type": ap.ActivityType.CREATE.value, "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}") logger.info(f"inbox_delete handle_replies obj={obj!r}")
if obj: if obj:
@ -273,7 +275,7 @@ class MicroblogPubBackend(Backend):
"activity.object.id": delete.get_object().id, "activity.object.id": delete.get_object().id,
"type": ap.ActivityType.CREATE.value, "type": ap.ActivityType.CREATE.value,
} }
) )["activity"]
).get_object() ).get_object()
self._handle_replies_delete(as_actor, obj) self._handle_replies_delete(as_actor, obj)