1
0

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
19 changed files with 90 additions and 1 deletions
@@ -20,6 +20,7 @@ class HybridTimelineChannel extends Channel {
public static requireCredential = true;
private withRenotes: boolean;
private withReplies: boolean;
private withBots: boolean;
private withFiles: boolean;
constructor(
@@ -41,6 +42,7 @@ class HybridTimelineChannel extends Channel {
this.withRenotes = params.withRenotes ?? true;
this.withReplies = params.withReplies ?? false;
this.withBots = params.withBots ?? true;
this.withFiles = params.withFiles ?? false;
// Subscribe events
@@ -50,6 +52,7 @@ class HybridTimelineChannel 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;
// チャンネルの投稿ではなく、自分自身の投稿 または
// チャンネルの投稿ではなく、その投稿のユーザーをフォローしている または