From eb167cf482eb304377179d016d922f9aa608b81f Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 19 Jun 2024 18:37:43 +0200 Subject: [PATCH] [backend/federation] Check for Instance.IsSuspended in PreDeliverQueue for ASFollow activities We're not currently using that property, but we may in the future. --- Iceshrimp.Backend/Core/Queues/PreDeliverQueue.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Iceshrimp.Backend/Core/Queues/PreDeliverQueue.cs b/Iceshrimp.Backend/Core/Queues/PreDeliverQueue.cs index 1fcea7dd..4c28996b 100644 --- a/Iceshrimp.Backend/Core/Queues/PreDeliverQueue.cs +++ b/Iceshrimp.Backend/Core/Queues/PreDeliverQueue.cs @@ -140,12 +140,13 @@ file static class QueryableExtensions this IQueryable query, ASActivity activity, DatabaseContext db ) { - if (activity is ASFollow) return query; - return query.Where(user => !db.Instances.Any(p => p.Host == user.Host && - ((p.IsNotResponding && - p.LastCommunicatedAt < - DateTime.UtcNow - TimeSpan.FromDays(7)) || - p.IsSuspended))); + return activity is ASFollow + ? query.Where(user => !db.Instances.Any(p => p.Host == user.Host && p.IsSuspended)) + : query.Where(user => !db.Instances.Any(p => p.Host == user.Host && + ((p.IsNotResponding && + p.LastCommunicatedAt < + DateTime.UtcNow - TimeSpan.FromDays(7)) || + p.IsSuspended))); } public static IQueryable SkipBlockedInstances(