This commit is contained in:
samunohito 2025-10-31 20:52:40 +09:00
parent 60e5e710cf
commit 699d50c6ec
2 changed files with 5 additions and 4 deletions

View File

@ -41,7 +41,8 @@ type TimelineOptions = {
excludeReplies?: boolean;
excludePureRenotes: boolean;
ignoreAuthorFromUserSuspension?: boolean;
includeMutedChannels?: boolean;
/** @default true */
excludeMutedChannels?: boolean;
dbFallback: (untilId: string | null, sinceId: string | null, limit: number) => Promise<MiNote[]>,
};
@ -121,7 +122,7 @@ export class FanoutTimelineEndpointService {
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)),
ps.includeMutedChannels ? Promise.resolve(new Set<string>()) : this.channelMutingService.mutingChannelsCache.fetch(me.id),
(ps.excludeMutedChannels ?? true) ? this.channelMutingService.mutingChannelsCache.fetch(me.id) : Promise.resolve(new Set<string>()),
]);
const parentFilter = filter;
@ -132,7 +133,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 (!ps.includeMutedChannels && isChannelRelated(note, userMutedChannels)) return false;
if ((ps.excludeMutedChannels ?? true) && isChannelRelated(note, userMutedChannels)) return false;
return parentFilter(note);
};

View File

@ -104,7 +104,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
useDbFallback: true,
redisTimelines: [`channelTimeline:${channel.id}`],
excludePureRenotes: false,
includeMutedChannels: true,
excludeMutedChannels: false,
noteFilter: note => {
// 共通機能を使うと見ているチャンネルそのものもミュートしてしまうので閲覧中のチャンネル以外を除く形にする
if (note.channelId === channel.id && (note.renoteChannelId === null || note.renoteChannelId === channel.id)) return true;