[backend/streaming] Fix pure renote without renote data filters (ISH-260)

This commit is contained in:
Laura Hausmann 2024-04-16 17:05:39 +02:00
parent f611e01bda
commit 0fc834693a
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
3 changed files with 3 additions and 3 deletions

View file

@ -50,7 +50,7 @@ public class PublicChannel(
{ {
if (!IsApplicableBool(note)) return null; if (!IsApplicableBool(note)) return null;
var res = EnforceRenoteReplyVisibility(note); var res = EnforceRenoteReplyVisibility(note);
return res is not { Note.IsPureRenote: true, Renote: null } ? null : res; return res is not { Note.IsPureRenote: true, Renote: null } ? res : null;
} }
private bool IsApplicableBool(Note note) private bool IsApplicableBool(Note note)

View file

@ -58,7 +58,7 @@ public class UserChannel(WebSocketConnection connection, bool notificationsOnly)
{ {
if (!IsApplicableBool(note)) return null; if (!IsApplicableBool(note)) return null;
var res = EnforceRenoteReplyVisibility(note); var res = EnforceRenoteReplyVisibility(note);
return res is not { Note.IsPureRenote: true, Renote: null } ? null : res; return res is not { Note.IsPureRenote: true, Renote: null } ? res : null;
} }
private bool IsApplicableBool(Note note) => private bool IsApplicableBool(Note note) =>

View file

@ -194,7 +194,7 @@ public sealed class StreamingConnectionAggregate : IDisposable
if (note.Renote != null && IsFiltered(note.Renote.User)) return null; if (note.Renote != null && IsFiltered(note.Renote.User)) return null;
var res = EnforceRenoteReplyVisibility(note); var res = EnforceRenoteReplyVisibility(note);
return res is not { Note.IsPureRenote: true, Renote: null } ? null : res; return res is not { Note.IsPureRenote: true, Renote: null } ? res : null;
} }
[SuppressMessage("ReSharper", "SuggestBaseTypeForParameter")] [SuppressMessage("ReSharper", "SuggestBaseTypeForParameter")]