From 2cec8003327e2524a920b92c75c9fced9cca5d1f Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Mon, 3 Jul 2023 20:25:03 +0200 Subject: [PATCH] Fix for pruned Move objects --- app/prune.py | 2 ++ app/templates/notifications.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/prune.py b/app/prune.py index 6cb25ac..75ca89b 100644 --- a/app/prune.py +++ b/app/prune.py @@ -102,6 +102,8 @@ async def _prune_old_inbox_objects( models.InboxObject.ap_type.in_(["Note"]), ) ), + # Keep Move object as they are linked to notifications + models.InboxObject.ap_type.not_in(["Move"]), # Filter by retention days models.InboxObject.ap_published_at < now() - timedelta(days=INBOX_RETENTION_DAYS), diff --git a/app/templates/notifications.html b/app/templates/notifications.html index b59eaeb..aaa541f 100644 --- a/app/templates/notifications.html +++ b/app/templates/notifications.html @@ -51,7 +51,7 @@ {% elif notif.notification_type.value == "unblock" %} {{ notif_actor_action(notif, "was unblocked") }} {{ utils.display_actor(notif.actor, actors_metadata) }} - {%- elif notif.notification_type.value == "move" %} + {%- elif notif.notification_type.value == "move" and notif.inbox_object %} {# for move notif, the actor is the target and the inbox object the Move activity #}