Merge branch 'develop' of https://github.com/transfem-org/Sharkey into develop
This commit is contained in:
commit
4b87753564
35 changed files with 277 additions and 86 deletions
|
@ -10,6 +10,7 @@ import { InviteCodeEntityService } from '@/core/entities/InviteCodeEntityService
|
|||
import { IdService } from '@/core/IdService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { generateInviteCode } from '@/misc/generate-invite-code.js';
|
||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||
import { ApiError } from '../../../error.js';
|
||||
|
||||
export const meta = {
|
||||
|
@ -60,6 +61,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
private inviteCodeEntityService: InviteCodeEntityService,
|
||||
private idService: IdService,
|
||||
private moderationLogService: ModerationLogService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.expiresAt && isNaN(Date.parse(ps.expiresAt))) {
|
||||
|
@ -78,6 +80,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
|
||||
const tickets = await Promise.all(ticketsPromises);
|
||||
|
||||
this.moderationLogService.log(me, 'createInvitation', {
|
||||
invitations: tickets,
|
||||
});
|
||||
|
||||
return await this.inviteCodeEntityService.packMany(tickets, me);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Brackets } from 'typeorm';
|
||||
import type { NotesRepository } from '@/models/_.js';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { QueryService } from '@/core/QueryService.js';
|
||||
|
@ -40,6 +41,7 @@ export const paramDef = {
|
|||
properties: {
|
||||
withFiles: { type: 'boolean', default: false },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
sinceId: { type: 'string', format: 'misskey:id' },
|
||||
untilId: { type: 'string', format: 'misskey:id' },
|
||||
|
@ -88,6 +90,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (ps.withFiles) {
|
||||
query.andWhere('note.fileIds != \'{}\'');
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const timeline = await query.limit(ps.limit).getMany();
|
||||
|
|
|
@ -52,6 +52,7 @@ export const paramDef = {
|
|||
includeLocalRenotes: { type: 'boolean', default: true },
|
||||
withFiles: { type: 'boolean', default: false },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
@ -137,6 +138,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (ps.withFiles) {
|
||||
query.andWhere('note.fileIds != \'{}\'');
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const timeline = await query.limit(ps.limit).getMany();
|
||||
|
|
|
@ -42,6 +42,7 @@ export const paramDef = {
|
|||
properties: {
|
||||
withFiles: { type: 'boolean', default: false },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
fileType: { type: 'array', items: {
|
||||
type: 'string',
|
||||
} },
|
||||
|
@ -110,6 +111,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
query.andWhere('0 = (SELECT COUNT(*) FROM drive_file df WHERE df.id = ANY(note."fileIds") AND df."isSensitive" = TRUE)');
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const timeline = await query.limit(ps.limit).getMany();
|
||||
|
|
|
@ -42,6 +42,7 @@ export const paramDef = {
|
|||
includeLocalRenotes: { type: 'boolean', default: true },
|
||||
withFiles: { type: 'boolean', default: false },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
@ -126,6 +127,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
if (ps.withFiles) {
|
||||
query.andWhere('note.fileIds != \'{}\'');
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
const timeline = await query.limit(ps.limit).getMany();
|
||||
|
|
|
@ -49,6 +49,8 @@ export const paramDef = {
|
|||
includeMyRenotes: { type: 'boolean', default: true },
|
||||
includeRenotedMyNotes: { type: 'boolean', default: true },
|
||||
includeLocalRenotes: { type: 'boolean', default: true },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
withFiles: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
|
@ -130,6 +132,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}));
|
||||
}
|
||||
|
||||
if (!ps.withReplies) {
|
||||
query.andWhere('note.replyId IS NULL');
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
if (ps.withFiles) {
|
||||
query.andWhere('note.fileIds != \'{}\'');
|
||||
}
|
||||
|
|
|
@ -41,7 +41,8 @@ export const paramDef = {
|
|||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id' },
|
||||
includeReplies: { type: 'boolean', default: true },
|
||||
withReplies: { type: 'boolean', default: false },
|
||||
withRenotes: { type: 'boolean', default: true },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
sinceId: { type: 'string', format: 'misskey:id' },
|
||||
untilId: { type: 'string', format: 'misskey:id' },
|
||||
|
@ -114,10 +115,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
}
|
||||
|
||||
if (!ps.includeReplies) {
|
||||
if (!ps.withReplies) {
|
||||
query.andWhere('note.replyId IS NULL');
|
||||
}
|
||||
|
||||
if (ps.withRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.renoteId IS NULL');
|
||||
qb.orWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.text IS NOT NULL');
|
||||
qb.orWhere('note.fileIds != \'{}\'');
|
||||
}));
|
||||
}));
|
||||
}
|
||||
|
||||
if (ps.includeMyRenotes === false) {
|
||||
query.andWhere(new Brackets(qb => {
|
||||
qb.orWhere('note.userId != :userId', { userId: user.id });
|
||||
|
|
|
@ -19,6 +19,7 @@ class GlobalTimelineChannel extends Channel {
|
|||
public static shouldShare = true;
|
||||
public static requireCredential = false;
|
||||
private withReplies: boolean;
|
||||
private withRenotes: boolean;
|
||||
|
||||
constructor(
|
||||
private metaService: MetaService,
|
||||
|
@ -37,7 +38,8 @@ class GlobalTimelineChannel extends Channel {
|
|||
const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null);
|
||||
if (!policies.gtlAvailable) return;
|
||||
|
||||
this.withReplies = params.withReplies as boolean;
|
||||
this.withReplies = params.withReplies ?? false;
|
||||
this.withRenotes = params.withRenotes ?? true;
|
||||
|
||||
// Subscribe events
|
||||
this.subscriber.on('notesStream', this.onNote);
|
||||
|
@ -68,6 +70,8 @@ class GlobalTimelineChannel extends Channel {
|
|||
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
|
||||
}
|
||||
|
||||
if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;
|
||||
|
||||
// Ignore notes from instances the user has muted
|
||||
if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return;
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ class HomeTimelineChannel extends Channel {
|
|||
public static shouldShare = true;
|
||||
public static requireCredential = true;
|
||||
private withReplies: boolean;
|
||||
private withRenotes: boolean;
|
||||
|
||||
constructor(
|
||||
private noteEntityService: NoteEntityService,
|
||||
|
@ -30,7 +31,8 @@ class HomeTimelineChannel extends Channel {
|
|||
|
||||
@bindThis
|
||||
public async init(params: any) {
|
||||
this.withReplies = params.withReplies as boolean;
|
||||
this.withReplies = params.withReplies ?? false;
|
||||
this.withRenotes = params.withRenotes ?? true;
|
||||
|
||||
this.subscriber.on('notesStream', this.onNote);
|
||||
}
|
||||
|
@ -77,6 +79,8 @@ class HomeTimelineChannel extends Channel {
|
|||
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
|
||||
}
|
||||
|
||||
if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;
|
||||
|
||||
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
|
||||
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
|
||||
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
|
||||
|
|
|
@ -19,6 +19,7 @@ class HybridTimelineChannel extends Channel {
|
|||
public static shouldShare = true;
|
||||
public static requireCredential = true;
|
||||
private withReplies: boolean;
|
||||
private withRenotes: boolean;
|
||||
|
||||
constructor(
|
||||
private metaService: MetaService,
|
||||
|
@ -37,7 +38,8 @@ class HybridTimelineChannel extends Channel {
|
|||
const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null);
|
||||
if (!policies.ltlAvailable) return;
|
||||
|
||||
this.withReplies = params.withReplies as boolean;
|
||||
this.withReplies = params.withReplies ?? false;
|
||||
this.withRenotes = params.withRenotes ?? true;
|
||||
|
||||
// Subscribe events
|
||||
this.subscriber.on('notesStream', this.onNote);
|
||||
|
@ -89,6 +91,8 @@ class HybridTimelineChannel extends Channel {
|
|||
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
|
||||
}
|
||||
|
||||
if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;
|
||||
|
||||
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
|
||||
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
|
||||
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
|
||||
|
|
|
@ -18,6 +18,7 @@ class LocalTimelineChannel extends Channel {
|
|||
public static shouldShare = true;
|
||||
public static requireCredential = false;
|
||||
private withReplies: boolean;
|
||||
private withRenotes: boolean;
|
||||
|
||||
constructor(
|
||||
private metaService: MetaService,
|
||||
|
@ -36,7 +37,8 @@ class LocalTimelineChannel extends Channel {
|
|||
const policies = await this.roleService.getUserPolicies(this.user ? this.user.id : null);
|
||||
if (!policies.ltlAvailable) return;
|
||||
|
||||
this.withReplies = params.withReplies as boolean;
|
||||
this.withReplies = params.withReplies ?? false;
|
||||
this.withRenotes = params.withRenotes ?? true;
|
||||
|
||||
// Subscribe events
|
||||
this.subscriber.on('notesStream', this.onNote);
|
||||
|
@ -68,6 +70,8 @@ class LocalTimelineChannel extends Channel {
|
|||
if (reply.userId !== this.user.id && note.userId !== this.user.id && reply.userId !== note.userId) return;
|
||||
}
|
||||
|
||||
if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return;
|
||||
|
||||
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
|
||||
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
|
||||
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する
|
||||
|
|
|
@ -56,6 +56,7 @@ export const moderationLogTypes = [
|
|||
'markSensitiveDriveFile',
|
||||
'unmarkSensitiveDriveFile',
|
||||
'resolveAbuseReport',
|
||||
'createInvitation',
|
||||
] as const;
|
||||
|
||||
export type ModerationLogPayloads = {
|
||||
|
@ -198,4 +199,7 @@ export type ModerationLogPayloads = {
|
|||
report: any;
|
||||
forwarded: boolean;
|
||||
};
|
||||
createInvitation: {
|
||||
invitations: any[];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -821,8 +821,10 @@ function showActions(ev) {
|
|||
action: () => {
|
||||
action.handler({
|
||||
text: text,
|
||||
cw: cw,
|
||||
}, (key, value) => {
|
||||
if (key === 'text') { text = value; }
|
||||
if (key === 'cw') { useCw = value !== null; cw = value; }
|
||||
});
|
||||
},
|
||||
})), ev.currentTarget ?? ev.target);
|
||||
|
|
|
@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :emojiUrls="note.emojis"/>
|
||||
<MkA v-if="note.renoteId" :class="$style.rp" :to="`/notes/${note.renoteId}`" v-on:click.stop>RN: ...</MkA>
|
||||
</div>
|
||||
<details v-if="note.files.length > 0">
|
||||
<details v-if="note.files.length > 0" :open="!defaultStore.state.collapseFiles">
|
||||
<summary>({{ i18n.t('withNFiles', { n: note.files.length }) }})</summary>
|
||||
<MkMediaList :mediaList="note.files"/>
|
||||
</details>
|
||||
|
@ -37,6 +37,7 @@ import MkPoll from '@/components/MkPoll.vue';
|
|||
import { i18n } from '@/i18n.js';
|
||||
import { $i } from '@/account.js';
|
||||
import { shouldCollapsed } from '@/scripts/collapsed.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
import { useRouter } from '@/router.js';
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -15,14 +15,19 @@ import * as sound from '@/scripts/sound.js';
|
|||
import { $i } from '@/account.js';
|
||||
import { defaultStore } from '@/store.js';
|
||||
|
||||
const props = defineProps<{
|
||||
const props = withDefaults(defineProps<{
|
||||
src: string;
|
||||
list?: string;
|
||||
antenna?: string;
|
||||
channel?: string;
|
||||
role?: string;
|
||||
sound?: boolean;
|
||||
}>();
|
||||
withRenotes?: boolean;
|
||||
withReplies?: boolean;
|
||||
}>(), {
|
||||
withRenotes: true,
|
||||
withReplies: false,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'note'): void;
|
||||
|
@ -62,10 +67,12 @@ if (props.src === 'antenna') {
|
|||
} else if (props.src === 'home') {
|
||||
endpoint = 'notes/timeline';
|
||||
query = {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
};
|
||||
connection = stream.useChannel('homeTimeline', {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
||||
|
@ -73,28 +80,34 @@ if (props.src === 'antenna') {
|
|||
} else if (props.src === 'local') {
|
||||
endpoint = 'notes/local-timeline';
|
||||
query = {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
};
|
||||
connection = stream.useChannel('localTimeline', {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
} else if (props.src === 'social') {
|
||||
endpoint = 'notes/hybrid-timeline';
|
||||
query = {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
};
|
||||
connection = stream.useChannel('hybridTimeline', {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
} else if (props.src === 'global') {
|
||||
endpoint = 'notes/global-timeline';
|
||||
query = {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
};
|
||||
connection = stream.useChannel('globalTimeline', {
|
||||
withReplies: defaultStore.state.showTimelineReplies,
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
} else if (props.src === 'mentions') {
|
||||
|
@ -116,9 +129,13 @@ if (props.src === 'antenna') {
|
|||
} else if (props.src === 'list') {
|
||||
endpoint = 'notes/user-list-timeline';
|
||||
query = {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
listId: props.list,
|
||||
};
|
||||
connection = stream.useChannel('userList', {
|
||||
withRenotes: props.withRenotes,
|
||||
withReplies: props.withReplies,
|
||||
listId: props.list,
|
||||
});
|
||||
connection.on('note', prepend);
|
||||
|
|
|
@ -114,8 +114,7 @@ function showMenu(ev) {
|
|||
}
|
||||
|
||||
function exploreOtherServers() {
|
||||
// TODO: 言語をよしなに
|
||||
window.open('https://join.misskey.page/ja-JP/instances', '_blank');
|
||||
window.open('https://join.misskey.page/instances', '_blank');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ import { onMounted, onUnmounted, ref, inject } from 'vue';
|
|||
import tinycolor from 'tinycolor2';
|
||||
import XTabs, { Tab } from './MkPageHeader.tabs.vue';
|
||||
import { scrollToTop } from '@/scripts/scroll.js';
|
||||
import { globalEvents } from '@/events';
|
||||
import { globalEvents } from '@/events.js';
|
||||
import { injectPageMetadata } from '@/scripts/page-metadata.js';
|
||||
import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
|
||||
|
||||
|
|
|
@ -84,20 +84,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</a>
|
||||
</div>
|
||||
</FormSection>
|
||||
<FormSection>
|
||||
<template #label>Special thanks</template>
|
||||
<div class="_gaps" style="text-align: center;">
|
||||
<div>
|
||||
<a style="display: inline-block;" class="masknetwork" title="Mask Network" href="https://mask.io/" target="_blank"><img width="180" src="https://misskey-hub.net/sponsors/masknetwork.png" alt="Mask Network"></a>
|
||||
</div>
|
||||
<div>
|
||||
<a style="display: inline-block;" class="skeb" title="Skeb" href="https://skeb.jp/" target="_blank"><img width="180" src="https://misskey-hub.net/sponsors/skeb.svg" alt="Skeb"></a>
|
||||
</div>
|
||||
<div>
|
||||
<a style="display: inline-block;" class="dcadvirth" title="DC Advirth" href="https://www.dotchain.ltd/advirth" target="_blank"><img width="100" src="https://misskey-hub.net/sponsors/dcadvirth.png" alt="DC Advirth"></a>
|
||||
</div>
|
||||
</div>
|
||||
</FormSection>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</div>
|
||||
|
|
|
@ -16,6 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<span v-else-if="log.type === 'createRole'">: {{ log.info.role.name }}</span>
|
||||
<span v-else-if="log.type === 'updateRole'">: {{ log.info.before.name }}</span>
|
||||
<span v-else-if="log.type === 'deleteRole'">: {{ log.info.role.name }}</span>
|
||||
<span v-else-if="log.type === 'addCustomEmoji'">: {{ log.info.emoji.name }}</span>
|
||||
<span v-else-if="log.type === 'updateCustomEmoji'">: {{ log.info.before.name }}</span>
|
||||
<span v-else-if="log.type === 'markSensitiveDriveFile'">: @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }}</span>
|
||||
<span v-else-if="log.type === 'unmarkSensitiveDriveFile'">: @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }}</span>
|
||||
|
|
|
@ -29,7 +29,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div class="_gaps_s">
|
||||
<MkSwitch v-model="showFixedPostForm">{{ i18n.ts.showFixedPostForm }}</MkSwitch>
|
||||
<MkSwitch v-model="showFixedPostFormInChannel">{{ i18n.ts.showFixedPostFormInChannel }}</MkSwitch>
|
||||
<MkSwitch v-model="showTimelineReplies">{{ i18n.ts.flagShowTimelineReplies }}<template #caption>{{ i18n.ts.flagShowTimelineRepliesDescription }} {{ i18n.ts.reflectMayTakeTime }}</template></MkSwitch>
|
||||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.pinnedList }}</template>
|
||||
<!-- 複数ピン止め管理できるようにしたいけどめんどいので一旦ひとつのみ -->
|
||||
|
@ -47,6 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch v-model="showNoteActionsOnlyHover">{{ i18n.ts.showNoteActionsOnlyHover }}</MkSwitch>
|
||||
<MkSwitch v-model="showClipButtonInNoteFooter">{{ i18n.ts.showClipButtonInNoteFooter }}</MkSwitch>
|
||||
<MkSwitch v-model="collapseRenotes">{{ i18n.ts.collapseRenotes }}</MkSwitch>
|
||||
<MkSwitch v-model="collapseFiles">Collapse files</MkSwitch>
|
||||
<MkSwitch v-model="autoloadConversation">Load conversation on replies</MkSwitch>
|
||||
<MkSwitch v-model="advancedMfm">{{ i18n.ts.enableAdvancedMfm }}</MkSwitch>
|
||||
<MkSwitch v-if="advancedMfm" v-model="animatedMfm">{{ i18n.ts.enableAnimatedMfm }}</MkSwitch>
|
||||
|
@ -225,6 +225,7 @@ const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNot
|
|||
const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter'));
|
||||
const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize'));
|
||||
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
|
||||
const collapseFiles = computed(defaultStore.makeGetterSetter('collapseFiles'));
|
||||
const autoloadConversation = computed(defaultStore.makeGetterSetter('autoloadConversation'));
|
||||
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
|
||||
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));
|
||||
|
@ -251,7 +252,6 @@ const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
|
|||
const mediaListWithOneImageAppearance = computed(defaultStore.makeGetterSetter('mediaListWithOneImageAppearance'));
|
||||
const notificationPosition = computed(defaultStore.makeGetterSetter('notificationPosition'));
|
||||
const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis'));
|
||||
const showTimelineReplies = computed(defaultStore.makeGetterSetter('showTimelineReplies'));
|
||||
const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn'));
|
||||
|
||||
watch(lang, () => {
|
||||
|
|
|
@ -15,9 +15,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div :class="$style.tl">
|
||||
<MkTimeline
|
||||
ref="tlComponent"
|
||||
:key="src"
|
||||
:key="src + withRenotes + withReplies"
|
||||
:src="src.split(':')[0]"
|
||||
:list="src.split(':')[1]"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
:sound="true"
|
||||
@queue="queueUpdated"
|
||||
/>
|
||||
|
@ -58,6 +60,8 @@ const rootEl = $shallowRef<HTMLElement>();
|
|||
let queue = $ref(0);
|
||||
let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global');
|
||||
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
||||
const withRenotes = $ref(true);
|
||||
const withReplies = $ref(false);
|
||||
|
||||
watch($$(src), () => queue = 0);
|
||||
|
||||
|
@ -129,7 +133,23 @@ function focus(): void {
|
|||
tlComponent.focus();
|
||||
}
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
const headerActions = $computed(() => [{
|
||||
icon: 'ti ti-dots',
|
||||
text: i18n.ts.options,
|
||||
handler: (ev) => {
|
||||
os.popupMenu([{
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
icon: 'ti ti-repeat',
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.withReplies,
|
||||
icon: 'ti ti-arrow-back-up',
|
||||
ref: $$(withReplies),
|
||||
}], ev.currentTarget ?? ev.target);
|
||||
},
|
||||
}]);
|
||||
|
||||
const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLists.value.map(l => ({
|
||||
key: 'list:' + l.id,
|
||||
|
|
|
@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template #header>
|
||||
<MkTab v-model="include" :class="$style.tab">
|
||||
<option :value="null">{{ i18n.ts.notes }}</option>
|
||||
<option value="replies">{{ i18n.ts.notesAndReplies }}</option>
|
||||
<option value="all">{{ i18n.ts.all }}</option>
|
||||
<option value="files">{{ i18n.ts.withFiles }}</option>
|
||||
</MkTab>
|
||||
</template>
|
||||
|
@ -36,7 +36,8 @@ const pagination = {
|
|||
limit: 10,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id,
|
||||
includeReplies: include.value === 'replies' || include.value === 'files',
|
||||
withRenotes: include.value === 'all',
|
||||
withReplies: include.value === 'all' || include.value === 'files',
|
||||
withFiles: include.value === 'files',
|
||||
})),
|
||||
};
|
||||
|
@ -51,7 +52,7 @@ const pagination = {
|
|||
|
||||
.tl {
|
||||
background: var(--bg);
|
||||
border-radius: var(--radius);
|
||||
overflow: clip;
|
||||
border-radius: var(--radius);
|
||||
overflow: clip;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -65,6 +65,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'account',
|
||||
default: true,
|
||||
},
|
||||
collapseFiles: {
|
||||
where: 'account',
|
||||
default: true,
|
||||
},
|
||||
rememberNoteVisibility: {
|
||||
where: 'account',
|
||||
default: false,
|
||||
|
@ -127,7 +131,6 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
'-',
|
||||
'announcements',
|
||||
'search',
|
||||
'lookup',
|
||||
'-',
|
||||
'favorites',
|
||||
'drive',
|
||||
|
|
|
@ -30,6 +30,8 @@ export type Column = {
|
|||
roleId?: string;
|
||||
includingTypes?: typeof notificationTypes[number][];
|
||||
tl?: 'home' | 'local' | 'social' | 'global';
|
||||
withRenotes?: boolean;
|
||||
withReplies?: boolean;
|
||||
};
|
||||
|
||||
export const deckStore = markRaw(new Storage('deck', {
|
||||
|
|
|
@ -20,12 +20,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</p>
|
||||
<p :class="$style.disabledDescription">{{ i18n.ts._disabledTimeline.description }}</p>
|
||||
</div>
|
||||
<MkTimeline v-else-if="column.tl" ref="timeline" :key="column.tl" :src="column.tl"/>
|
||||
<MkTimeline
|
||||
v-else-if="column.tl"
|
||||
ref="timeline"
|
||||
:key="column.tl + withRenotes + withReplies"
|
||||
:src="column.tl"
|
||||
:withRenotes="withRenotes"
|
||||
:withReplies="withReplies"
|
||||
/>
|
||||
</XColumn>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { onMounted, watch } from 'vue';
|
||||
import XColumn from './column.vue';
|
||||
import { removeColumn, updateColumn, Column } from './deck-store.js';
|
||||
import MkTimeline from '@/components/MkTimeline.vue';
|
||||
|
@ -43,6 +50,20 @@ let disabled = $ref(false);
|
|||
|
||||
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 withRenotes = $ref(props.column.withRenotes ?? true);
|
||||
const withReplies = $ref(props.column.withReplies ?? false);
|
||||
|
||||
watch($$(withRenotes), v => {
|
||||
updateColumn(props.column.id, {
|
||||
withRenotes: v,
|
||||
});
|
||||
});
|
||||
|
||||
watch($$(withReplies), v => {
|
||||
updateColumn(props.column.id, {
|
||||
withReplies: v,
|
||||
});
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
if (props.column.tl == null) {
|
||||
|
@ -82,6 +103,14 @@ const menu = [{
|
|||
icon: 'ti ti-pencil',
|
||||
text: i18n.ts.timeline,
|
||||
action: setType,
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.showRenotes,
|
||||
ref: $$(withRenotes),
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts.withReplies,
|
||||
ref: $$(withReplies),
|
||||
}];
|
||||
</script>
|
||||
|
||||
|
|
|
@ -2604,10 +2604,13 @@ type ModerationLog = {
|
|||
} | {
|
||||
type: 'unmarkSensitiveDriveFile';
|
||||
info: ModerationLogPayloads['unmarkSensitiveDriveFile'];
|
||||
} | {
|
||||
type: 'createInvitation';
|
||||
info: ModerationLogPayloads['createInvitation'];
|
||||
});
|
||||
|
||||
// @public (undocumented)
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport"];
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "createInvitation"];
|
||||
|
||||
// @public (undocumented)
|
||||
export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"];
|
||||
|
|
|
@ -74,6 +74,7 @@ export const moderationLogTypes = [
|
|||
'markSensitiveDriveFile',
|
||||
'unmarkSensitiveDriveFile',
|
||||
'resolveAbuseReport',
|
||||
'createInvitation',
|
||||
] as const;
|
||||
|
||||
export type ModerationLogPayloads = {
|
||||
|
@ -216,4 +217,7 @@ export type ModerationLogPayloads = {
|
|||
report: any;
|
||||
forwarded: boolean;
|
||||
};
|
||||
createInvitation: {
|
||||
invitations: any[];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -666,4 +666,7 @@ export type ModerationLog = {
|
|||
} | {
|
||||
type: 'unmarkSensitiveDriveFile';
|
||||
info: ModerationLogPayloads['unmarkSensitiveDriveFile'];
|
||||
} | {
|
||||
type: 'createInvitation';
|
||||
info: ModerationLogPayloads['createInvitation'];
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue