spec(backend/stream): モデレーターにも一般ユーザーと同じく通常の投稿はcdn経由で配信するように (MisskeyIO#920)

This commit is contained in:
あわわわとーにゅ 2025-01-29 07:30:05 +09:00 committed by GitHub
parent d7d270b789
commit 020c4f1716
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 97 additions and 43 deletions

View file

@ -24,7 +24,7 @@ import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
import { useStream } from '@/stream.js';
import * as sound from '@/scripts/sound.js';
import { deepMerge } from '@/scripts/merge.js';
import { $i, iAmModerator } from '@/account.js';
import { $i } from '@/account.js';
import { instance } from '@/instance.js';
import { defaultStore } from '@/store.js';
import { Paging } from '@/components/MkPagination.vue';
@ -108,7 +108,6 @@ async function prepend(data) {
let connection: Misskey.ChannelConnection | null = null;
let connection2: Misskey.ChannelConnection | null = null;
let paginationQuery: Paging | null = null;
const minimize = !iAmModerator;
const stream = useStream();
@ -117,13 +116,13 @@ function connectChannel() {
if (props.antenna == null) return;
connection = stream.useChannel('antenna', {
antennaId: props.antenna,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'home') {
connection = stream.useChannel('homeTimeline', {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
minimize: minimize,
minimize: true,
});
connection2 = stream.useChannel('main');
} else if (props.src === 'local') {
@ -131,27 +130,27 @@ function connectChannel() {
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'media') {
connection = stream.useChannel('hybridTimeline', {
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: true,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'social') {
connection = stream.useChannel('hybridTimeline', {
withRenotes: props.withRenotes,
withReplies: props.withReplies,
withFiles: props.onlyFiles ? true : undefined,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'global') {
connection = stream.useChannel('globalTimeline', {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'mentions') {
connection = stream.useChannel('main');
@ -170,19 +169,19 @@ function connectChannel() {
withRenotes: props.withRenotes,
withFiles: props.onlyFiles ? true : undefined,
listId: props.list,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'channel') {
if (props.channel == null) return;
connection = stream.useChannel('channel', {
channelId: props.channel,
minimize: minimize,
minimize: true,
});
} else if (props.src === 'role') {
if (props.role == null) return;
connection = stream.useChannel('roleTimeline', {
roleId: props.role,
minimize: minimize,
minimize: true,
});
}
if (props.src !== 'directs' && props.src !== 'mentions') connection?.on('note', prepend);