feat: 管理者権限を持ってる人はローカルの非公開投稿(ホーム)も見れるようなTLを追加

This commit is contained in:
mattyatea 2023-09-03 19:42:42 +09:00
parent 724ed47e5f
commit e1b22165db
8 changed files with 315 additions and 2 deletions

View file

@ -88,6 +88,15 @@ if (props.src === 'antenna') {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
} else if (props.src === 'all') {
endpoint = 'notes/hybrid-all-timeline';
query = {
withReplies: defaultStore.state.showTimelineReplies,
};
connection = stream.useChannel(' ', {
withReplies: defaultStore.state.showTimelineReplies,
});
connection.on('note', prepend);
} else if (props.src === 'global') {
endpoint = 'notes/global-timeline';
query = {

View file

@ -45,6 +45,7 @@ const XTutorial = defineAsyncComponent(() => import('./timeline.tutorial.vue'));
const isLocalTimelineAvailable = ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable);
const isGlobalTimelineAvailable = ($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable);
const isAdmin = ($i != null && $i.isAdmin);
const keymap = {
't': focus,
};
@ -100,7 +101,7 @@ async function chooseChannel(ev: MouseEvent): Promise<void> {
os.popupMenu(items, ev.currentTarget ?? ev.target);
}
function saveSrc(newSrc: 'home' | 'local' | 'social' | 'global'): void {
function saveSrc(newSrc: 'home' | 'local' | 'social' | 'global' | 'all'): void {
defaultStore.set('tl', {
...defaultStore.state.tl,
src: newSrc,
@ -143,6 +144,11 @@ const headerTabs = $computed(() => [{
title: i18n.ts._timelines.global,
icon: 'ti ti-whirl',
iconOnly: true,
}] : []), ...(isAdmin ? [{
key: 'all',
title: 'all',
icon: 'ti ti-whirl',
iconOnly: true,
}] : []), {
icon: 'ti ti-list',
title: i18n.ts.lists,