summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-06-03 17:12:16 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-06-03 17:12:16 -0400
commit6c58171c419d001f0a2f5b9a8544fa2bf11ff973 (patch)
tree3a33327de162fc382dd3ad6efb157eb15d3c730d /packages/backend/src/server/api/stream/channels
parentadd instance.isSilenced to PackedUserLite (diff)
downloadsharkey-6c58171c419d001f0a2f5b9a8544fa2bf11ff973.tar.gz
sharkey-6c58171c419d001f0a2f5b9a8544fa2bf11ff973.tar.bz2
sharkey-6c58171c419d001f0a2f5b9a8544fa2bf11ff973.zip
copy changes to home channel
Diffstat (limited to 'packages/backend/src/server/api/stream/channels')
-rw-r--r--packages/backend/src/server/api/stream/channels/home-timeline.ts17
1 files changed, 6 insertions, 11 deletions
diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts
index dfdb491113..eb8a3f1ab5 100644
--- a/packages/backend/src/server/api/stream/channels/home-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts
@@ -50,24 +50,19 @@ class HomeTimelineChannel extends Channel {
if (!isMe && !Object.hasOwn(this.following, note.userId)) return;
}
- if (note.visibility === 'followers') {
- if (!isMe && !Object.hasOwn(this.following, note.userId)) return;
- } else if (note.visibility === 'specified') {
- if (!isMe && !note.visibleUserIds!.includes(this.user!.id)) return;
- }
+ if (!this.isNoteVisibleToMe(note)) return;
if (note.reply) {
const reply = note.reply;
- if (this.following[note.userId]?.withReplies) {
- // 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く
- if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return;
- } else {
+ // 自分のフォローしていないユーザーの 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 (note.user.isSilenced && !this.following[note.userId] && note.userId !== this.user!.id) return;
+ if ((note.user.isSilenced || note.user.instance?.isSilenced) && !this.following[note.userId] && note.userId !== this.user!.id) return;
// 純粋なリノート(引用リノートでないリノート)の場合
if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) {
@@ -75,7 +70,7 @@ class HomeTimelineChannel extends Channel {
if (note.renote.reply) {
const reply = note.renote.reply;
// 自分のフォローしていないユーザーの visibility: followers な投稿への返信のリノートは弾く
- if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return;
+ if (!this.isNoteVisibleToMe(reply)) return;
}
}