Handle inbox delete handler for actors
This commit is contained in:
parent
68c27e083f
commit
04e75c78e0
1 changed files with 17 additions and 0 deletions
17
app/boxes.py
17
app/boxes.py
|
@ -1124,6 +1124,23 @@ async def _handle_delete_activity(
|
||||||
logger.info("Removing actor from follower")
|
logger.info("Removing actor from follower")
|
||||||
await db_session.delete(follower)
|
await db_session.delete(follower)
|
||||||
|
|
||||||
|
# Also mark Follow activities for this actor as deleted
|
||||||
|
follow_activities = (
|
||||||
|
await db_session.scalars(
|
||||||
|
select(models.OutboxObject).where(
|
||||||
|
models.OutboxObject.ap_type == "Follow",
|
||||||
|
models.OutboxObject.relates_to_actor_id
|
||||||
|
== ap_object_to_delete.id,
|
||||||
|
models.OutboxObject.is_deleted.is_(False),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).all()
|
||||||
|
for follow_activity in follow_activities:
|
||||||
|
logger.info(
|
||||||
|
f"Marking Follow activity {follow_activity.ap_id} as deleted"
|
||||||
|
)
|
||||||
|
follow_activity.is_deleted = True
|
||||||
|
|
||||||
following = (
|
following = (
|
||||||
await db_session.scalars(
|
await db_session.scalars(
|
||||||
select(models.Following).where(
|
select(models.Following).where(
|
||||||
|
|
Loading…
Reference in a new issue