From dd4773fc2732a0f33fcff69c91508cf12fcddb2c Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 26 Aug 2022 21:23:16 +0200 Subject: [PATCH] Fix share dedup --- app/boxes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/boxes.py b/app/boxes.py index 138c56a..3b1f55c 100644 --- a/app/boxes.py +++ b/app/boxes.py @@ -1657,7 +1657,7 @@ async def _handle_announce_activity( skip_delta = timedelta(hours=1) if ( now() - as_utc(relates_to_inbox_object.ap_published_at) # type: ignore - ) > skip_delta or ( + ) < skip_delta or ( await db_session.scalar( select(func.count(func.distinct(models.InboxObject.id))).where( models.InboxObject.ap_type == "Announce", @@ -1667,6 +1667,8 @@ async def _handle_announce_activity( ) ) ) > 0: + announce_activity.is_hidden_from_stream = True + else: announce_activity.is_hidden_from_stream = not is_from_following else: