diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2025-11-07 08:39:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-07 08:39:21 +0900 |
| commit | 729abbef621aea5b8b697644181915935b74bbf8 (patch) | |
| tree | 27545c0cfd3e6272dd40de2c77daf0d2adec3e6c /packages/backend/src/core/FanoutTimelineEndpointService.ts | |
| parent | Bump version to 2025.11.0-alpha.1 (diff) | |
| download | misskey-729abbef621aea5b8b697644181915935b74bbf8.tar.gz misskey-729abbef621aea5b8b697644181915935b74bbf8.tar.bz2 misskey-729abbef621aea5b8b697644181915935b74bbf8.zip | |
feat: チャンネルミュートの実装 (#14105)
* add channel_muting table and entities
* add channel_muting services
* タイムライン取得処理への組み込み
* misskey-jsの型とインターフェース生成
* Channelスキーマにミュート情報を追加
* フロントエンドの実装
* 条件が逆だったのを修正
* 期限切れミュートを掃除する機能を実装
* TLの抽出条件調節
* 名前の変更と変更不要の差分をロールバック
* 修正漏れ
* isChannelRelatedの条件に誤りがあった
* [wip] テスト追加
* テストの追加と検出した不備の修正
* fix test
* fix CHANGELOG.md
* 通常はFTTにしておく
* 実装忘れ対応
* fix merge
* fix merge
* add channel tl test
* fix CHANGELOG.md
* remove unused import
* fix lint
* fix test
* fix favorite -> favorited
* exclude -> include
* fix CHANGELOG.md
* fix CHANGELOG.md
* maintenance
* fix CHANGELOG.md
* fix
* fix ci
* regenerate
* fix
* Revert "fix"
This reverts commit 699d50c6ec798777d8e9667cb5d45a26b06bfc93.
* fixed
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core/FanoutTimelineEndpointService.ts')
| -rw-r--r-- | packages/backend/src/core/FanoutTimelineEndpointService.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/core/FanoutTimelineEndpointService.ts b/packages/backend/src/core/FanoutTimelineEndpointService.ts index 94c5691bf4..e39d70d683 100644 --- a/packages/backend/src/core/FanoutTimelineEndpointService.ts +++ b/packages/backend/src/core/FanoutTimelineEndpointService.ts @@ -19,6 +19,8 @@ import { isQuote, isRenote } from '@/misc/is-renote.js'; import { CacheService } from '@/core/CacheService.js'; import { isReply } from '@/misc/is-reply.js'; import { isInstanceMuted } from '@/misc/is-instance-muted.js'; +import { ChannelMutingService } from '@/core/ChannelMutingService.js'; +import { isChannelRelated } from '@/misc/is-channel-related.js'; type NoteFilter = (note: MiNote) => boolean; @@ -35,6 +37,7 @@ type TimelineOptions = { ignoreAuthorFromBlock?: boolean; ignoreAuthorFromMute?: boolean; ignoreAuthorFromInstanceBlock?: boolean; + ignoreAuthorChannelFromMute?: boolean; excludeNoFiles?: boolean; excludeReplies?: boolean; excludePureRenotes: boolean; @@ -55,6 +58,7 @@ export class FanoutTimelineEndpointService { private cacheService: CacheService, private fanoutTimelineService: FanoutTimelineService, private utilityService: UtilityService, + private channelMutingService: ChannelMutingService, ) { } @@ -111,11 +115,13 @@ export class FanoutTimelineEndpointService { userIdsWhoMeMutingRenotes, userIdsWhoBlockingMe, userMutedInstances, + userMutedChannels, ] = await Promise.all([ this.cacheService.userMutingsCache.fetch(ps.me.id), this.cacheService.renoteMutingsCache.fetch(ps.me.id), this.cacheService.userBlockedCache.fetch(ps.me.id), this.cacheService.userProfileCache.fetch(me.id).then(p => new Set(p.mutedInstances)), + this.channelMutingService.mutingChannelsCache.fetch(me.id), ]); const parentFilter = filter; @@ -126,6 +132,7 @@ export class FanoutTimelineEndpointService { if (isUserRelated(note.renote, userIdsWhoMeMuting, ps.ignoreAuthorFromMute)) return false; if (!ps.ignoreAuthorFromMute && isRenote(note) && !isQuote(note) && userIdsWhoMeMutingRenotes.has(note.userId)) return false; if (isInstanceMuted(note, userMutedInstances)) return false; + if (isChannelRelated(note, userMutedChannels, ps.ignoreAuthorChannelFromMute)) return false; return parentFilter(note); }; |