summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-03 17:46:49 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-03 17:46:49 -0400
commit5035287571cb8075585866eeee8221cc0c82864a (patch)
treeee2a69422cb46b85510ea220aad33c47acedf935 /packages/backend/src/server/api
parentcopy changes to hybrid channel (diff)
downloadsharkey-5035287571cb8075585866eeee8221cc0c82864a.tar.gz
sharkey-5035287571cb8075585866eeee8221cc0c82864a.tar.bz2
sharkey-5035287571cb8075585866eeee8221cc0c82864a.zip
copy changes to global channel
Diffstat (limited to 'packages/backend/src/server/api')
-rw-r--r--packages/backend/src/server/api/stream/channels/global-timeline.ts28
1 files changed, 22 insertions, 6 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 c899ad9490..515deb1253 100644
--- a/packages/backend/src/server/api/stream/channels/global-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts
@@ -48,20 +48,36 @@ class GlobalTimelineChannel extends Channel {
@bindThis
private async onNote(note: Packed<'Note'>) {
+ const isMe = this.user?.id === note.userId;
+
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;
- if (note.user.requireSigninToViewContents && this.user == null) return;
- if (note.renote && note.renote.user.requireSigninToViewContents && this.user == null) return;
- if (note.reply && note.reply.user.requireSigninToViewContents && this.user == null) return;
- if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return;
+ if (this.isNoteMutedOrBlocked(note)) return;
+ if (!this.isNoteVisibleToMe(note)) return;
- if (note.user.isSilenced && !this.following[note.userId] && note.userId !== this.user!.id) return;
+ if (note.reply) {
+ const reply = note.reply;
+ // 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く
+ if (!this.isNoteVisibleToMe(reply)) return;
+ if (!this.following[note.userId]?.withReplies) {
+ // 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
+ if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
+ }
+ }
- if (this.isNoteMutedOrBlocked(note)) return;
+ // 純粋なリノート(引用リノートでないリノート)の場合
+ if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) {
+ if (!this.withRenotes) return;
+ if (note.renote.reply) {
+ const reply = note.renote.reply;
+ // 自分のフォローしていないユーザーの visibility: followers な投稿への返信のリノートは弾く
+ if (!this.isNoteVisibleToMe(reply)) return;
+ }
+ }
const clonedNote = await this.assignMyReaction(note);
await this.hideNote(clonedNote);