[backend/core] Don't generate reply notifications for remote users

This commit is contained in:
Laura Hausmann 2024-09-14 02:42:44 +02:00
parent a0f3edf4fd
commit 14f078d145
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -58,9 +58,15 @@ public class NotificationService(
.Select(p => p.BlockerId) .Select(p => p.BlockerId)
.ToListAsync(); .ToListAsync();
var remote = await db.Users
.Where(p => users.Contains(p.Id) && p.IsRemoteUser)
.Select(p => p.Id)
.ToListAsync();
var notifications = users var notifications = users
.Where(p => p != note.UserId) .Where(p => p != note.UserId)
.Except(blocks) .Except(blocks)
.Except(remote)
.Select(p => new Notification .Select(p => new Notification
{ {
Id = IdHelpers.GenerateSlowflakeId(), Id = IdHelpers.GenerateSlowflakeId(),