summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-07-30 19:44:08 +0900
committerGitHub <noreply@github.com>2024-07-30 19:44:08 +0900
commit8f40f932e4bac6b4a90a464041a00df315a3c693 (patch)
tree18f0a7d21de03d56e0dc730f4953d5dfb6d1ab7f /packages/backend/src/server/api/stream/channels
parentBump version to 2024.7.0-rc.7 (diff)
downloadsharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.gz
sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.tar.bz2
sharkey-8f40f932e4bac6b4a90a464041a00df315a3c693.zip
自分のフォロワー限定投稿に対するリプライがホームタイムラインで見えないことが有る問題を修正 (#13835)
* fix: reply to my follower notes are not shown on the home timeline * fix: reply to follower note by non-following is on social timeline * docs: changelog * test: add endpoint test for changes * test(e2e): 自分のfollowers投稿に対するリプライが流れる * test(e2e/streaming): 自分のfollowers投稿に対するリプライが流れる * test(e2e/streaming): フォローしていないユーザによるフォロワー限定投稿に対するリプライがソーシャルタイムラインで表示されることがある問題 * test(e2e/timelines): try fixing typecheck error --------- Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/server/api/stream/channels')
-rw-r--r--packages/backend/src/server/api/stream/channels/home-timeline.ts4
-rw-r--r--packages/backend/src/server/api/stream/channels/hybrid-timeline.ts12
2 files changed, 12 insertions, 4 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 1f440732a6..66644ed58c 100644
--- a/packages/backend/src/server/api/stream/channels/home-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts
@@ -60,7 +60,7 @@ class HomeTimelineChannel extends Channel {
const reply = note.reply;
if (this.following[note.userId]?.withReplies) {
// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く
- if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return;
+ if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return;
} else {
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
@@ -73,7 +73,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)) return;
+ if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return;
}
}
diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
index 6938b6e3ea..75bd13221f 100644
--- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
@@ -76,14 +76,22 @@ class HybridTimelineChannel extends Channel {
const reply = note.reply;
if ((this.following[note.userId]?.withReplies ?? false) || this.withReplies) {
// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く
- if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return;
+ if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId) && reply.userId !== this.user!.id) return;
} else {
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return;
}
}
- if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return;
+ // 純粋なリノート(引用リノートでないリノート)の場合
+ if (isRenotePacked(note) && !isQuotePacked(note) && note.renote) {
+ if (!this.withRenotes) return;
+ 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.user && note.renoteId && !note.text) {
if (note.renote && Object.keys(note.renote.reactions).length > 0) {