diff options
| author | anatawa12 <anatawa12@icloud.com> | 2023-12-04 14:38:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-04 14:38:21 +0900 |
| commit | 18109fcef760dee8171364fd0382375c4047b8e7 (patch) | |
| tree | 20bc2c25c8e90070ea8aa77c06cb3b7fa3a28810 /packages/backend/src/server/api/endpoints/channels | |
| parent | fix dev build (#12566) (diff) | |
| download | misskey-18109fcef760dee8171364fd0382375c4047b8e7.tar.gz misskey-18109fcef760dee8171364fd0382375c4047b8e7.tar.bz2 misskey-18109fcef760dee8171364fd0382375c4047b8e7.zip | |
Filter User / Instance Mutes in FanoutTimelineEndpointService (#12565)
* fix: unnecessary logging in FanoutTimelineEndpointService
* chore: TimelineOptions
* chore: add FanoutTimelineName type
* chore: forbid specifying both withReplies and withFiles since it's not implemented correctly
* chore: filter mutes, replies, renotes, files in FanoutTimelineEndpointService
* revert unintended changes
* use isReply in NoteCreateService
* fix: excludePureRenotes is not implemented
* fix: replies to me is excluded from local timeline
* chore(frontend): forbid enabling both withReplies and withFiles
* docs(changelog): インスタンスミュートが効かない問題の修正について言及
Diffstat (limited to 'packages/backend/src/server/api/endpoints/channels')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/channels/timeline.ts | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 9ef494d6d8..006228ceee 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -4,15 +4,13 @@ */ import { Inject, Injectable } from '@nestjs/common'; -import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { ChannelsRepository, MiNote, NotesRepository } from '@/models/_.js'; +import type { ChannelsRepository, NotesRepository } from '@/models/_.js'; import { QueryService } from '@/core/QueryService.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import ActiveUsersChart from '@/core/chart/charts/active-users.js'; import { DI } from '@/di-symbols.js'; import { IdService } from '@/core/IdService.js'; -import { isUserRelated } from '@/misc/is-user-related.js'; import { CacheService } from '@/core/CacheService.js'; import { MetaService } from '@/core/MetaService.js'; import { FanoutTimelineEndpointService } from '@/core/FanoutTimelineEndpointService.js'; @@ -94,12 +92,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- return await this.noteEntityService.packMany(await this.getFromDb({ untilId, sinceId, limit: ps.limit, channelId: channel.id }, me), me); } - const [ - userIdsWhoMeMuting, - ] = me ? await Promise.all([ - this.cacheService.userMutingsCache.fetch(me.id), - ]) : [new Set<string>()]; - return await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -108,11 +100,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- me, useDbFallback: true, redisTimelines: [`channelTimeline:${channel.id}`], - noteFilter: note => { - if (me && isUserRelated(note, userIdsWhoMeMuting)) return false; - - return true; - }, + excludePureRenotes: false, dbFallback: async (untilId, sinceId, limit) => { return await this.getFromDb({ untilId, sinceId, limit, channelId: channel.id }, me); }, |