summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-11 10:15:44 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-11 10:15:44 +0900
commit7a8d5e58400a51218d673211219111238a8b7ae8 (patch)
tree3d1a3708337098d735a2ace446de44b46f0204bf /packages/backend/src/server/api/stream/channels
parentfix(backend): フォローしているユーザーからの自分の投稿... (diff)
downloadsharkey-7a8d5e58400a51218d673211219111238a8b7ae8.tar.gz
sharkey-7a8d5e58400a51218d673211219111238a8b7ae8.tar.bz2
sharkey-7a8d5e58400a51218d673211219111238a8b7ae8.zip
enhance: ローカルタイムライン、ソーシャルタイムラインで返信を含むかどうか設定可能に
Resolve #12001
Diffstat (limited to 'packages/backend/src/server/api/stream/channels')
-rw-r--r--packages/backend/src/server/api/stream/channels/hybrid-timeline.ts4
-rw-r--r--packages/backend/src/server/api/stream/channels/local-timeline.ts4
2 files changed, 6 insertions, 2 deletions
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 d5f5d54e46..adedca5152 100644
--- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
@@ -19,6 +19,7 @@ class HybridTimelineChannel extends Channel {
public static shouldShare = false;
public static requireCredential = true;
private withRenotes: boolean;
+ private withReplies: boolean;
private withFiles: boolean;
constructor(
@@ -39,6 +40,7 @@ class HybridTimelineChannel extends Channel {
if (!policies.ltlAvailable) return;
this.withRenotes = params.withRenotes ?? true;
+ this.withReplies = params.withReplies ?? false;
this.withFiles = params.withFiles ?? false;
// Subscribe events
@@ -87,7 +89,7 @@ class HybridTimelineChannel extends Channel {
if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances ?? []))) return;
// 関係ない返信は除外
- if (note.reply && !this.following[note.userId]?.withReplies) {
+ if (note.reply && !this.following[note.userId]?.withReplies && !this.withReplies) {
const reply = note.reply;
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
diff --git a/packages/backend/src/server/api/stream/channels/local-timeline.ts b/packages/backend/src/server/api/stream/channels/local-timeline.ts
index 94c22f8915..69aa366f00 100644
--- a/packages/backend/src/server/api/stream/channels/local-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/local-timeline.ts
@@ -18,6 +18,7 @@ class LocalTimelineChannel extends Channel {
public static shouldShare = false;
public static requireCredential = false;
private withRenotes: boolean;
+ private withReplies: boolean;
private withFiles: boolean;
constructor(
@@ -38,6 +39,7 @@ class LocalTimelineChannel extends Channel {
if (!policies.ltlAvailable) return;
this.withRenotes = params.withRenotes ?? true;
+ this.withReplies = params.withReplies ?? false;
this.withFiles = params.withFiles ?? false;
// Subscribe events
@@ -66,7 +68,7 @@ class LocalTimelineChannel extends Channel {
}
// 関係ない返信は除外
- if (note.reply && this.user && !this.following[note.userId]?.withReplies) {
+ if (note.reply && this.user && !this.following[note.userId]?.withReplies && !this.withReplies) {
const reply = note.reply;
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user.id && note.userId !== this.user.id && reply.userId !== note.userId) return;