a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/core] Improve code reuse

+4 -14
+4 -14
Iceshrimp.Backend/Core/Federation/ActivityPub/ActivityDeliverService.cs
··· 49 49 50 50 public async Task DeliverToConditionalAsync(ASActivity activity, User actor, Note note) 51 51 { 52 - if (note.Visibility != Note.NoteVisibility.Specified) 53 - { 54 - await DeliverToFollowersAsync(activity, actor, note.User.IsLocalUser ? [] : [note.User]); 55 - return; 56 - } 57 - 58 - var recipients = await db.Users 59 - .Where(p => note.VisibleUserIds.Prepend(note.User.Id).Contains(p.Id)) 60 - .Where(p => p.IsRemoteUser) 61 - .ToArrayAsync(); 62 - 63 - await DeliverToAsync(activity, actor, recipients); 52 + var recipientIds = note.VisibleUserIds.Prepend(note.User.Id); 53 + await DeliverToConditionalAsync(activity, actor, note, recipientIds); 64 54 } 65 55 66 56 public async Task DeliverToConditionalAsync( ··· 71 61 .Where(p => recipientIds.Contains(p.Id)) 72 62 .Where(p => p.IsRemoteUser) 73 63 .Select(p => new User { Id = p.Id }) 74 - .ToListAsync(); 75 - 64 + .ToArrayAsync(); 65 + 76 66 if (note.Visibility == Note.NoteVisibility.Specified) 77 67 await DeliverToAsync(activity, actor, recipients.ToArray()); 78 68 else