fix: 일부 타임라인 옵션이 작동하지 않음
- (friendly) 알림 영역 활성화 - (friendly) 위젯 영역 활성화 - 리노트 표시 - 고양이만 보기
This commit is contained in:
parent
9b68d487d5
commit
448a19e141
|
@ -32,6 +32,7 @@ type TimelineOptions = {
|
|||
excludeNoFiles?: boolean;
|
||||
excludeReplies?: boolean;
|
||||
excludePureRenotes: boolean;
|
||||
withCats: boolean;
|
||||
dbFallback: (untilId: string | null, sinceId: string | null, limit: number) => Promise<MiNote[]>,
|
||||
};
|
||||
|
||||
|
@ -93,6 +94,11 @@ export class FanoutTimelineEndpointService {
|
|||
filter = (note) => !isPureRenote(note) && parentFilter(note);
|
||||
}
|
||||
|
||||
if (ps.withCats) {
|
||||
const parentFilter = filter;
|
||||
filter = (note) => (note.user ? note.user.isCat : false) && parentFilter(note);
|
||||
}
|
||||
|
||||
if (ps.me) {
|
||||
const me = ps.me;
|
||||
const [
|
||||
|
|
|
@ -101,6 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
useDbFallback: true,
|
||||
redisTimelines: [`channelTimeline:${channel.id}`],
|
||||
excludePureRenotes: false,
|
||||
withCats: false,
|
||||
dbFallback: async (untilId, sinceId, limit) => {
|
||||
return await this.getFromDb({ untilId, sinceId, limit, channelId: channel.id }, me);
|
||||
},
|
||||
|
|
|
@ -153,6 +153,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
useDbFallback: serverSettings.enableFanoutTimelineDbFallback,
|
||||
alwaysIncludeMyNotes: true,
|
||||
excludePureRenotes: !ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({
|
||||
untilId,
|
||||
sinceId,
|
||||
|
|
|
@ -125,6 +125,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
: ['localTimeline'],
|
||||
alwaysIncludeMyNotes: true,
|
||||
excludePureRenotes: !ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
dbFallback: async (untilId, sinceId, limit) => await this.getFromDb({
|
||||
untilId,
|
||||
sinceId,
|
||||
|
|
|
@ -113,6 +113,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
redisTimelines: ps.withFiles ? [`homeTimelineWithFiles:${me.id}`] : [`homeTimeline:${me.id}`],
|
||||
alwaysIncludeMyNotes: true,
|
||||
excludePureRenotes: !ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
noteFilter: note => {
|
||||
if (note.reply && note.reply.visibility === 'followers') {
|
||||
if (!Object.hasOwn(followings, note.reply.userId)) return false;
|
||||
|
|
|
@ -129,6 +129,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
redisTimelines: ps.withFiles ? [`userListTimelineWithFiles:${list.id}`] : [`userListTimeline:${list.id}`],
|
||||
alwaysIncludeMyNotes: true,
|
||||
excludePureRenotes: !ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
dbFallback: async (untilId, sinceId, limit) => await this.getFromDb(list, {
|
||||
untilId,
|
||||
sinceId,
|
||||
|
|
|
@ -121,6 +121,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
excludeReplies: ps.withChannelNotes && !ps.withReplies, // userTimelineWithChannel may include replies
|
||||
excludeNoFiles: ps.withChannelNotes && ps.withFiles, // userTimelineWithChannel may include notes without files
|
||||
excludePureRenotes: !ps.withRenotes,
|
||||
withCats: ps.withCats,
|
||||
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;
|
||||
|
|
|
@ -242,14 +242,17 @@ const headerActions = $computed(() => {
|
|||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableNotifications,
|
||||
ref: $$(friendlyEnableNotifications),
|
||||
disabled: false,
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.friendlyEnableWidgets,
|
||||
ref: $$(friendlyEnableWidgets),
|
||||
disabled: false,
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
ref: $$(withRenotes),
|
||||
disabled: false,
|
||||
}, src === 'local' || src === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
|
@ -264,6 +267,7 @@ const headerActions = $computed(() => {
|
|||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
ref: $$(onlyCats),
|
||||
disabled: false,
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
},
|
||||
|
|
|
@ -124,6 +124,7 @@ const menu = [{
|
|||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
ref: $$(withRenotes),
|
||||
disabled: false,
|
||||
}, props.column.tl === 'local' || props.column.tl === 'social' ? {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRepliesToOthersInTimeline,
|
||||
|
@ -138,6 +139,7 @@ const menu = [{
|
|||
type: 'switch',
|
||||
text: i18n.ts.showCatOnly,
|
||||
ref: $$(onlyCats),
|
||||
disabled: false,
|
||||
}];
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue