[backend/federation] Check for Instance.IsSuspended in PreDeliverQueue for ASFollow activities

We're not currently using that property, but we may in the future.
This commit is contained in:
Laura Hausmann 2024-06-19 18:37:43 +02:00
parent 9dbc7cfc14
commit eb167cf482
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -140,8 +140,9 @@ file static class QueryableExtensions
this IQueryable<InboxQueryResult> query, ASActivity activity, DatabaseContext db
)
{
if (activity is ASFollow) return query;
return query.Where(user => !db.Instances.Any(p => p.Host == user.Host &&
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)) ||