diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-18 07:29:16 +0200 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-18 07:29:16 +0200 |
| commit | c21d2556043e8833426c5523b753593b0fa196ae (patch) | |
| tree | b367acc3d46f890ab09bfdcb0ce933271891f349 /packages/backend/src/server/api/stream/channels/global-timeline.ts | |
| parent | fix: reports not sending email (diff) | |
| download | sharkey-c21d2556043e8833426c5523b753593b0fa196ae.tar.gz sharkey-c21d2556043e8833426c5523b753593b0fa196ae.tar.bz2 sharkey-c21d2556043e8833426c5523b753593b0fa196ae.zip | |
add: Bot Trending Toggle, Hide Bot in Timeline client option
Diffstat (limited to 'packages/backend/src/server/api/stream/channels/global-timeline.ts')
| -rw-r--r-- | packages/backend/src/server/api/stream/channels/global-timeline.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index c499d1787e..58e53fdd8c 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -20,6 +20,7 @@ class GlobalTimelineChannel extends Channel { public static requireCredential = false; private withRenotes: boolean; private withFiles: boolean; + private withBots: boolean; constructor( private metaService: MetaService, @@ -40,6 +41,7 @@ class GlobalTimelineChannel extends Channel { this.withRenotes = params.withRenotes ?? true; this.withFiles = params.withFiles ?? false; + this.withBots = params.withBots ?? true; // Subscribe events this.subscriber.on('notesStream', this.onNote); @@ -48,6 +50,7 @@ class GlobalTimelineChannel 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.visibility !== 'public') return; if (note.channelId != null) return; |