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): インスタンスミュートが効かない問題の修正について言及
This commit is contained in:
anatawa12
2023-12-04 14:38:21 +09:00
committed by GitHub
parent b2c4973cda
commit 18109fcef7
15 changed files with 176 additions and 179 deletions

View File

@@ -202,7 +202,7 @@ function focusDown() {
}
function switchItem(item: MenuSwitch & { ref: any }) {
if (item.disabled) return;
if (typeof item.disabled === 'boolean' ? item.disabled : item.disabled.value) return;
item.ref = !item.ref;
}

View File

@@ -157,17 +157,17 @@ const headerActions = $computed(() => {
os.popupMenu([{
type: 'switch',
text: i18n.ts.showRenotes,
icon: 'ti ti-repeat',
ref: $$(withRenotes),
}, src === 'local' || src === 'social' ? {
type: 'switch',
text: i18n.ts.showRepliesToOthersInTimeline,
ref: $$(withReplies),
disabled: $$(onlyFiles),
} : undefined, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
icon: 'ti ti-photo',
ref: $$(onlyFiles),
disabled: src === 'local' || src === 'social' ? $$(withReplies) : false,
}], ev.currentTarget ?? ev.target);
},
},

View File

@@ -14,7 +14,7 @@ export type MenuLabel = { type: 'label', text: string };
export type MenuLink = { type: 'link', to: string, text: string, icon?: string, indicate?: boolean, avatar?: Misskey.entities.User };
export type MenuA = { type: 'a', href: string, target?: string, download?: string, text: string, icon?: string, indicate?: boolean };
export type MenuUser = { type: 'user', user: Misskey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction };
export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean };
export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean | Ref<boolean> };
export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean, avatar?: Misskey.entities.User; action: MenuAction };
export type MenuParent = { type: 'parent', text: string, icon?: string, children: MenuItem[] | (() => Promise<MenuItem[]> | MenuItem[]) };

View File

@@ -120,10 +120,12 @@ const menu = [{
type: 'switch',
text: i18n.ts.showRepliesToOthersInTimeline,
ref: $$(withReplies),
disabled: $$(onlyFiles),
} : undefined, {
type: 'switch',
text: i18n.ts.fileAttachedOnly,
ref: $$(onlyFiles),
disabled: props.column.tl === 'local' || props.column.tl === 'social' ? $$(withReplies) : false,
}];
</script>