fix(backend): 「ファイル付きのみ」のTLでファイル無しの新着ノートが表示される

Fix #11939
This commit is contained in:
syuilo 2023-10-09 17:48:09 +09:00
parent 7066d61730
commit 6ff98846e6
7 changed files with 22 additions and 3 deletions

View file

@ -17,6 +17,7 @@ class HomeTimelineChannel extends Channel {
public static shouldShare = false;
public static requireCredential = true;
private withRenotes: boolean;
private withFiles: boolean;
constructor(
private noteEntityService: NoteEntityService,
@ -31,12 +32,15 @@ class HomeTimelineChannel extends Channel {
@bindThis
public async init(params: any) {
this.withRenotes = params.withRenotes ?? true;
this.withFiles = params.withFiles ?? false;
this.subscriber.on('notesStream', this.onNote);
}
@bindThis
private async onNote(note: Packed<'Note'>) {
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (note.channelId) {
if (!this.followingChannels.has(note.channelId)) return;
} else {