[backend/federation] Reject activities by suspended users

This commit is contained in:
Laura Hausmann 2024-08-13 00:02:21 +02:00
parent a61ca299b6
commit 2181d01e54
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -58,6 +58,9 @@ public class ActivityHandlerService(
UpdateInstanceMetadataInBackground(resolvedActor.Host, new Uri(resolvedActor.Uri).Host); UpdateInstanceMetadataInBackground(resolvedActor.Host, new Uri(resolvedActor.Uri).Host);
if (resolvedActor.IsSuspended && activity is not ASDelete)
throw GracefulException.UnprocessableEntity("Actor is suspended");
var inboxUser = inboxUserId != null var inboxUser = inboxUserId != null
? await db.Users.IncludeCommonProperties().FirstOrDefaultAsync(p => p.Id == inboxUserId) ? await db.Users.IncludeCommonProperties().FirstOrDefaultAsync(p => p.Id == inboxUserId)
: null; : null;