summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-04-17 14:23:41 +0900
committerGitHub <noreply@github.com>2024-04-17 14:23:41 +0900
commite423b8ce4b28ecbe4e300fc67389e4def3761eb6 (patch)
tree43d5e15ead542d1f0dad7dc30e0f86dc7e192535 /packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
parentenhance(frontend): フォローするかどうかの確認ダイアログを... (diff)
downloadmisskey-e423b8ce4b28ecbe4e300fc67389e4def3761eb6.tar.gz
misskey-e423b8ce4b28ecbe4e300fc67389e4def3761eb6.tar.bz2
misskey-e423b8ce4b28ecbe4e300fc67389e4def3761eb6.zip
細かいミュートの処理の修正 (#13695)
* fix: some replies are removed from global timeline * refactor: 各チャンネルのミュートとブロックの処理をまとめる * fix: リノートをミュートでその人のノートのリノートをミュートしていたを修正 * refactor: isPureRenotePackedを他のところでも使う * docs(changelog): CHANGELOGを更新 * test: withReplies = falseでフォローしてる人によるリプライが流れてくる * test: ノートミュートしているユーザーの通常ノートのリノートが流れてくる/含まれる
Diffstat (limited to 'packages/backend/src/server/api/stream/channels/hybrid-timeline.ts')
-rw-r--r--packages/backend/src/server/api/stream/channels/hybrid-timeline.ts16
1 files changed, 3 insertions, 13 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 d67da6f565..575d23d53c 100644
--- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
+++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts
@@ -4,14 +4,12 @@
*/
import { Injectable } from '@nestjs/common';
-import { checkWordMute } from '@/misc/check-word-mute.js';
-import { isUserRelated } from '@/misc/is-user-related.js';
-import { isInstanceMuted } from '@/misc/is-instance-muted.js';
import type { Packed } from '@/misc/json-schema.js';
import { MetaService } from '@/core/MetaService.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { bindThis } from '@/decorators.js';
import { RoleService } from '@/core/RoleService.js';
+import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js';
import Channel, { type MiChannelService } from '../channel.js';
class HybridTimelineChannel extends Channel {
@@ -71,8 +69,7 @@ class HybridTimelineChannel extends Channel {
if (!isMe && !note.visibleUserIds!.includes(this.user!.id)) return;
}
- // Ignore notes from instances the user has muted
- if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances))) return;
+ if (this.isNoteMutedOrBlocked(note)) return;
if (note.reply) {
const reply = note.reply;
@@ -85,14 +82,7 @@ class HybridTimelineChannel extends Channel {
}
}
- if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;
-
- // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
- if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
- // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
- if (isUserRelated(note, this.userIdsWhoBlockingMe)) return;
-
- if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return;
+ if (isRenotePacked(note) && !isQuotePacked(note) && !this.withRenotes) return;
if (this.user && note.renoteId && !note.text) {
if (note.renote && Object.keys(note.renote.reactions).length > 0) {