summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels/channel.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/channel.ts
parentenhance(frontend): フォローするかどうかの確認ダイアログを... (diff)
downloadsharkey-e423b8ce4b28ecbe4e300fc67389e4def3761eb6.tar.gz
sharkey-e423b8ce4b28ecbe4e300fc67389e4def3761eb6.tar.bz2
sharkey-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/channel.ts')
-rw-r--r--packages/backend/src/server/api/stream/channels/channel.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/backend/src/server/api/stream/channels/channel.ts b/packages/backend/src/server/api/stream/channels/channel.ts
index 90ee1ecda5..140dd3dd9b 100644
--- a/packages/backend/src/server/api/stream/channels/channel.ts
+++ b/packages/backend/src/server/api/stream/channels/channel.ts
@@ -4,10 +4,10 @@
*/
import { Injectable } from '@nestjs/common';
-import { isUserRelated } from '@/misc/is-user-related.js';
import type { Packed } from '@/misc/json-schema.js';
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
import { bindThis } from '@/decorators.js';
+import { isRenotePacked, isQuotePacked } from '@/misc/is-renote.js';
import Channel, { type MiChannelService } from '../channel.js';
class ChannelChannel extends Channel {
@@ -38,14 +38,9 @@ class ChannelChannel extends Channel {
private async onNote(note: Packed<'Note'>) {
if (note.channelId !== this.channelId) return;
- // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
- if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
- // 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
- if (isUserRelated(note, this.userIdsWhoBlockingMe)) return;
+ if (this.isNoteMutedOrBlocked(note)) return;
- if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return;
-
- if (this.user && note.renoteId && !note.text) {
+ if (this.user && isRenotePacked(note) && !isQuotePacked(note)) {
if (note.renote && Object.keys(note.renote.reactions).length > 0) {
const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renote, this.user.id);
note.renote.myReaction = myRenoteReaction;