diff --git a/packages/backend/src/server/api/endpoints/channels/timeline.ts b/packages/backend/src/server/api/endpoints/channels/timeline.ts index 0b1944fb99..806b203b51 100644 --- a/packages/backend/src/server/api/endpoints/channels/timeline.ts +++ b/packages/backend/src/server/api/endpoints/channels/timeline.ts @@ -107,8 +107,6 @@ export default class extends Endpoint { // eslint- return await this.noteEntityService.packMany(await this.getFromDb({ untilId, sinceId, limit: ps.limit, channelId: channel.id, withFiles: ps.withFiles, withRenotes: ps.withRenotes }, me), me); } - const threadMutings = me ? await this.cacheService.threadMutingsCache.fetch(me.id) : null; - return await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -122,13 +120,6 @@ export default class extends Endpoint { // eslint- dbFallback: async (untilId, sinceId, limit) => { return await this.getFromDb({ untilId, sinceId, limit, channelId: channel.id, withFiles: ps.withFiles, withRenotes: ps.withRenotes }, me); }, - noteFilter: note => { - if (threadMutings?.has(note.threadId ?? note.id)) { - return false; - } - - return true; - }, }); }); } diff --git a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts index ecf75421f5..0c39ec1f57 100644 --- a/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/hybrid-timeline.ts @@ -145,14 +145,6 @@ export default class extends Endpoint { // eslint- ]; } - const [ - followings, - mutedThreads, - ] = await Promise.all([ - this.cacheService.userFollowingsCache.fetch(me.id), - this.cacheService.threadMutingsCache.fetch(me.id), - ]); - const redisTimeline = await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -164,17 +156,6 @@ export default class extends Endpoint { // eslint- alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, excludeBots: !ps.withBots, - noteFilter: note => { - if (note.reply && note.reply.visibility === 'followers') { - if (!followings.has(note.reply.userId) && note.reply.userId !== me.id) return false; - } - - if (mutedThreads.has(note.threadId ?? note.id)) { - return false; - } - - return true; - }, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({ untilId, sinceId, diff --git a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts index 592f2e2feb..7b9e70aefd 100644 --- a/packages/backend/src/server/api/endpoints/notes/local-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/local-timeline.ts @@ -117,8 +117,6 @@ export default class extends Endpoint { // eslint- return await this.noteEntityService.packMany(timeline, me); } - const mutedThreads = me ? await this.cacheService.threadMutingsCache.fetch(me.id) : null; - const timeline = await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -143,13 +141,6 @@ export default class extends Endpoint { // eslint- withBots: ps.withBots, withRenotes: ps.withRenotes, }, me), - noteFilter: note => { - if (mutedThreads?.has(note.threadId ?? note.id)) { - return false; - } - - return true; - }, }); if (me) { diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index d442de2a64..790c87ae60 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -97,14 +97,6 @@ export default class extends Endpoint { // eslint- return await this.noteEntityService.packMany(timeline, me); } - const [ - followings, - threadMutings, - ] = await Promise.all([ - this.cacheService.userFollowingsCache.fetch(me.id), - this.cacheService.threadMutingsCache.fetch(me.id), - ]); - const timeline = this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -115,16 +107,6 @@ export default class extends Endpoint { // eslint- redisTimelines: ps.withFiles ? [`homeTimelineWithFiles:${me.id}`] : [`homeTimeline:${me.id}`], alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, - noteFilter: note => { - if (note.reply && note.reply.visibility === 'followers') { - if (!followings.has(note.reply.userId) && note.reply.userId !== me.id) return false; - } - if (!ps.withBots && note.user?.isBot) return false; - - if (threadMutings.has(note.threadId ?? note.id)) return false; - - return true; - }, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({ untilId, sinceId, diff --git a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts index ff37e0aaba..6d245226ac 100644 --- a/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/user-list-timeline.ts @@ -127,6 +127,7 @@ export default class extends Endpoint { // eslint- redisTimelines: ps.withFiles ? [`userListTimelineWithFiles:${list.id}`] : [`userListTimeline:${list.id}`], alwaysIncludeMyNotes: true, excludePureRenotes: !ps.withRenotes, + ignoreAuthorFromUserSilence: true, dbFallback: async (untilId, sinceId, limit) => await this.getFromDb(list, { untilId, sinceId, diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index b87d4abd7c..4db16ad7a0 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -134,8 +134,6 @@ export default class extends Endpoint { // eslint- if (ps.withReplies) redisTimelines.push(`userTimelineWithReplies:${ps.userId}`); if (ps.withChannelNotes) redisTimelines.push(`userTimelineWithChannel:${ps.userId}`); - const isFollowing = me && (await this.cacheService.userFollowingsCache.fetch(me.id)).has(ps.userId); - const timeline = await this.fanoutTimelineEndpointService.timeline({ untilId, sinceId, @@ -147,14 +145,13 @@ export default class extends Endpoint { // eslint- ignoreAuthorFromMute: true, ignoreAuthorFromInstanceBlock: true, ignoreAuthorFromUserSuspension: true, + ignoreAuthorFromUserSilence: true, excludeReplies: ps.withChannelNotes && !ps.withReplies, // userTimelineWithChannel may include replies excludeNoFiles: ps.withChannelNotes && ps.withFiles, // userTimelineWithChannel may include notes without files excludePureRenotes: !ps.withRenotes, excludeBots: !ps.withBots, noteFilter: note => { if (note.channel?.isSensitive && !isSelf) return false; - if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false; - if (note.visibility === 'followers' && !isFollowing && !isSelf) return false; // These are handled by DB fallback, but we duplicate them here in case a timeline was already populated with notes if (!ps.withRepliesToSelf && note.reply?.userId === note.userId) return false;