add: Bot Trending Toggle, Hide Bot in Timeline client option

This commit is contained in:
Mar0xy 2023-10-18 07:29:16 +02:00
parent fa5cf36602
commit c21d255604
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
19 changed files with 90 additions and 1 deletions

View file

@ -19,6 +19,7 @@ class LocalTimelineChannel extends Channel {
public static requireCredential = false;
private withRenotes: boolean;
private withReplies: boolean;
private withBots: boolean;
private withFiles: boolean;
constructor(
@ -40,6 +41,7 @@ class LocalTimelineChannel extends Channel {
this.withRenotes = params.withRenotes ?? true;
this.withReplies = params.withReplies ?? false;
this.withBots = params.withBots ?? true;
this.withFiles = params.withFiles ?? false;
// Subscribe events
@ -49,6 +51,7 @@ class LocalTimelineChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return;
if (!this.withBots && note.user.isBot) return;
if (note.user.host !== null) return;
if (note.visibility !== 'public') return;