parent
7066d61730
commit
6ff98846e6
7 changed files with 22 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue