Merge branch 'develop' into ssmucny-events
This commit is contained in:
commit
3f3d3894de
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
-->
|
||||
|
||||
## 2023.8.0 (unreleased)
|
||||
## 2023.9.0 (unreleased)
|
||||
|
||||
### General
|
||||
- OAuth 2.0のサポート
|
||||
|
|
@ -23,23 +23,33 @@
|
|||
- チャンネルをセンシティブ指定できるようになりました
|
||||
|
||||
### Client
|
||||
- プロフィールにその人が作ったPlayの一覧出せるように
|
||||
- メニューのスイッチの動作を改善
|
||||
- 絵文字ピッカーの検索の表示件数を100件に増加
|
||||
- 投稿フォームのプレビューの表示状態を記憶するように
|
||||
- Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように
|
||||
- Enhance: 自分が押したリアクションのデザインを改善
|
||||
- Enhance: ノート検索にローカルのみ検索可能なオプションの追加
|
||||
- Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように
|
||||
- `$[rainbow ]`記法が、動きのあるMFMが無効になっていても使用できるようになりました
|
||||
- Playの操作を行うAPI TokenをAPIコンソールから発行できるように
|
||||
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
|
||||
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
|
||||
- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正
|
||||
- Fix: word mute for sub note is not applied
|
||||
- Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正
|
||||
- Fix: Misskeyプラグインをインストールする際のAiScriptバージョンのチェックが0.14.0以降に対応していない問題を修正
|
||||
- Fix: 他のサーバーのユーザーへ「メッセージを送信」した時の初期テキストのメンションが間違っている問題を修正
|
||||
|
||||
### Server
|
||||
- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように
|
||||
- cacheRemoteFilesの初期値はfalseになりました
|
||||
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
|
||||
- Webhookのペイロードにサーバーのurlが含まれるようになりました
|
||||
- Fix: 一部のfeatured noteを照会できない問題を修正
|
||||
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
|
||||
- Fix: ジョブキュー管理画面の認証を回避できる問題を修正
|
||||
- Fix: 一部のサーバー内部エラーがスタックトレースを返さないように修正
|
||||
|
||||
## 13.14.2
|
||||
|
||||
|
|
|
|||
|
|
@ -680,6 +680,7 @@ createNewClip: "Create new clip"
|
|||
unclip: "Unclip"
|
||||
confirmToUnclipAlreadyClippedNote: "This note is already part of the \"{name}\" clip. Do you want to remove it from this clip instead?"
|
||||
public: "Public"
|
||||
private: "Private"
|
||||
i18nInfo: "Misskey is being translated into various languages by volunteers. You can help at {link}."
|
||||
manageAccessTokens: "Manage access tokens"
|
||||
accountInfo: "Account Info"
|
||||
|
|
|
|||
|
|
@ -684,6 +684,7 @@ export interface Locale {
|
|||
"unclip": string;
|
||||
"confirmToUnclipAlreadyClippedNote": string;
|
||||
"public": string;
|
||||
"private": string;
|
||||
"i18nInfo": string;
|
||||
"manageAccessTokens": string;
|
||||
"accountInfo": string;
|
||||
|
|
@ -1894,6 +1895,10 @@ export interface Locale {
|
|||
"write:gallery": string;
|
||||
"read:gallery-likes": string;
|
||||
"write:gallery-likes": string;
|
||||
"read:flash": string;
|
||||
"write:flash": string;
|
||||
"read:flash-likes": string;
|
||||
"write:flash-likes": string;
|
||||
};
|
||||
"_auth": {
|
||||
"shareAccessTitle": string;
|
||||
|
|
|
|||
|
|
@ -681,6 +681,7 @@ createNewClip: "新しいクリップを作成"
|
|||
unclip: "クリップ解除"
|
||||
confirmToUnclipAlreadyClippedNote: "このノートはすでにクリップ「{name}」に含まれています。ノートをこのクリップから除外しますか?"
|
||||
public: "パブリック"
|
||||
private: "非公開"
|
||||
i18nInfo: "Misskeyは有志によって様々な言語に翻訳されています。{link}で翻訳に協力できます。"
|
||||
manageAccessTokens: "アクセストークンの管理"
|
||||
accountInfo: "アカウント情報"
|
||||
|
|
@ -1812,6 +1813,10 @@ _permissions:
|
|||
"write:gallery": "ギャラリーを操作する"
|
||||
"read:gallery-likes": "ギャラリーのいいねを見る"
|
||||
"write:gallery-likes": "ギャラリーのいいねを操作する"
|
||||
"read:flash": "Playを見る"
|
||||
"write:flash": "Playを操作する"
|
||||
"read:flash-likes": "Playのいいねを見る"
|
||||
"write:flash-likes": "Playのいいねを操作する"
|
||||
|
||||
_auth:
|
||||
shareAccessTitle: "アプリへのアクセス許可"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "misskey",
|
||||
"version": "13.14.2",
|
||||
"version": "2023.9.0-beta.2",
|
||||
"codename": "nasubi",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export class PlayVisibility1689102832143 {
|
||||
name = 'PlayVisibility1690796169261'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "public"."flash" ADD "visibility" character varying(512) DEFAULT 'public'`, undefined);
|
||||
}
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "public"."flash" DROP COLUMN "visibility"`, undefined);
|
||||
}
|
||||
}
|
||||
|
|
@ -25,6 +25,8 @@ type Q =
|
|||
{ op: '<', k: K, v: number } |
|
||||
{ op: '>=', k: K, v: number } |
|
||||
{ op: '<=', k: K, v: number } |
|
||||
{ op: 'is null', k: K} |
|
||||
{ op: 'is not null', k: K} |
|
||||
{ op: 'and', qs: Q[] } |
|
||||
{ op: 'or', qs: Q[] } |
|
||||
{ op: 'not', q: Q };
|
||||
|
|
@ -50,6 +52,8 @@ function compileQuery(q: Q): string {
|
|||
case '<=': return `(${q.k} <= ${compileValue(q.v)})`;
|
||||
case 'and': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' AND ') })`;
|
||||
case 'or': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' OR ') })`;
|
||||
case 'is null': return `(${q.k} IS NULL)`;
|
||||
case 'is not null': return `(${q.k} IS NOT NULL)`;
|
||||
case 'not': return `(NOT ${compileQuery(q.q)})`;
|
||||
default: throw new Error('unrecognized query operator');
|
||||
}
|
||||
|
|
@ -170,7 +174,7 @@ export class SearchService {
|
|||
if (opts.channelId) filter.qs.push({ op: '=', k: 'channelId', v: opts.channelId });
|
||||
if (opts.host) {
|
||||
if (opts.host === '.') {
|
||||
// TODO: Meilisearchが2023/05/07現在値がNULLかどうかのクエリが書けない
|
||||
filter.qs.push({ op: 'is null', k: 'userHost' });
|
||||
} else {
|
||||
filter.qs.push({ op: '=', k: 'userHost', v: opts.host });
|
||||
}
|
||||
|
|
@ -204,6 +208,14 @@ export class SearchService {
|
|||
.leftJoinAndSelect('reply.user', 'replyUser')
|
||||
.leftJoinAndSelect('renote.user', 'renoteUser');
|
||||
|
||||
if (opts.host) {
|
||||
if (opts.host === '.') {
|
||||
query.andWhere('user.host IS NULL');
|
||||
} else {
|
||||
query.andWhere('user.host = :host', { host: opts.host });
|
||||
}
|
||||
}
|
||||
|
||||
this.queryService.generateVisibilityQuery(query, me);
|
||||
if (me) this.queryService.generateMutedUserQuery(query, me);
|
||||
if (me) this.queryService.generateBlockedUserQuery(query, me);
|
||||
|
|
|
|||
|
|
@ -61,4 +61,13 @@ export class MiFlash {
|
|||
default: 0,
|
||||
})
|
||||
public likedCount: number;
|
||||
|
||||
/**
|
||||
* public ... 公開
|
||||
* private ... プロフィールには表示しない
|
||||
*/
|
||||
@Column('varchar', {
|
||||
length: 512, default: 'public',
|
||||
})
|
||||
public visibility: 'public' | 'private';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ export class WebhookDeliverProcessorService {
|
|||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
server: this.config.url,
|
||||
hookId: job.data.webhookId,
|
||||
userId: job.data.userId,
|
||||
eventId: job.data.eventId,
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ import * as ep___users_lists_unfavorite from './endpoints/users/lists/unfavorite
|
|||
import * as ep___users_lists_create_from_public from './endpoints/users/lists/create-from-public.js';
|
||||
import * as ep___users_notes from './endpoints/users/notes.js';
|
||||
import * as ep___users_pages from './endpoints/users/pages.js';
|
||||
import * as ep___users_flashs from './endpoints/users/flashs.js';
|
||||
import * as ep___users_reactions from './endpoints/users/reactions.js';
|
||||
import * as ep___users_recommendation from './endpoints/users/recommendation.js';
|
||||
import * as ep___users_relation from './endpoints/users/relation.js';
|
||||
|
|
@ -683,6 +684,7 @@ const $users_lists_unfavorite: Provider = { provide: 'ep:users/lists/unfavorite'
|
|||
const $users_lists_create_from_public: Provider = { provide: 'ep:users/lists/create-from-public', useClass: ep___users_lists_create_from_public.default };
|
||||
const $users_notes: Provider = { provide: 'ep:users/notes', useClass: ep___users_notes.default };
|
||||
const $users_pages: Provider = { provide: 'ep:users/pages', useClass: ep___users_pages.default };
|
||||
const $users_flashs: Provider = { provide: 'ep:users/flashs', useClass: ep___users_flashs.default };
|
||||
const $users_reactions: Provider = { provide: 'ep:users/reactions', useClass: ep___users_reactions.default };
|
||||
const $users_recommendation: Provider = { provide: 'ep:users/recommendation', useClass: ep___users_recommendation.default };
|
||||
const $users_relation: Provider = { provide: 'ep:users/relation', useClass: ep___users_relation.default };
|
||||
|
|
@ -1033,6 +1035,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention
|
|||
$users_lists_create_from_public,
|
||||
$users_notes,
|
||||
$users_pages,
|
||||
$users_flashs,
|
||||
$users_reactions,
|
||||
$users_recommendation,
|
||||
$users_relation,
|
||||
|
|
@ -1375,6 +1378,7 @@ const $retention: Provider = { provide: 'ep:retention', useClass: ep___retention
|
|||
$users_lists_create_from_public,
|
||||
$users_notes,
|
||||
$users_pages,
|
||||
$users_flashs,
|
||||
$users_reactions,
|
||||
$users_recommendation,
|
||||
$users_relation,
|
||||
|
|
|
|||
|
|
@ -337,6 +337,7 @@ import * as ep___users_lists_create_from_public from './endpoints/users/lists/cr
|
|||
import * as ep___users_lists_update from './endpoints/users/lists/update.js';
|
||||
import * as ep___users_notes from './endpoints/users/notes.js';
|
||||
import * as ep___users_pages from './endpoints/users/pages.js';
|
||||
import * as ep___users_flashs from './endpoints/users/flashs.js';
|
||||
import * as ep___users_reactions from './endpoints/users/reactions.js';
|
||||
import * as ep___users_recommendation from './endpoints/users/recommendation.js';
|
||||
import * as ep___users_relation from './endpoints/users/relation.js';
|
||||
|
|
@ -681,6 +682,7 @@ const eps = [
|
|||
['users/lists/create-from-public', ep___users_lists_create_from_public],
|
||||
['users/notes', ep___users_notes],
|
||||
['users/pages', ep___users_pages],
|
||||
['users/flashs', ep___users_flashs],
|
||||
['users/reactions', ep___users_reactions],
|
||||
['users/recommendation', ep___users_recommendation],
|
||||
['users/relation', ep___users_relation],
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
private globalEventService: GlobalEventService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if ((ps.keywords.length === 0) || ps.keywords[0].every(x => x === '')) {
|
||||
throw new Error('invalid param');
|
||||
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
||||
throw new Error('either keywords or excludeKeywords is required.');
|
||||
}
|
||||
|
||||
const currentAntennasCount = await this.antennasRepository.countBy({
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
private globalEventService: GlobalEventService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
|
||||
throw new Error('either keywords or excludeKeywords is required.');
|
||||
}
|
||||
// Fetch the antenna
|
||||
const antenna = await this.antennasRepository.findOneBy({
|
||||
id: ps.antennaId,
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ export const paramDef = {
|
|||
permissions: { type: 'array', items: {
|
||||
type: 'string',
|
||||
} },
|
||||
visibility: { type: 'string', enum: ['public', 'private'] },
|
||||
},
|
||||
required: ['flashId', 'title', 'summary', 'script', 'permissions'],
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Endpoint } from '@/server/api/endpoint-base.js';
|
||||
import { QueryService } from '@/core/QueryService.js';
|
||||
import { FlashEntityService } from '@/core/entities/FlashEntityService.js';
|
||||
import type { FlashsRepository } from '@/models/index.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
|
||||
export const meta = {
|
||||
tags: ['users', 'flashs'],
|
||||
|
||||
description: 'Show all flashs this user created.',
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Flash',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', format: 'misskey:id' },
|
||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||
sinceId: { type: 'string', format: 'misskey:id' },
|
||||
untilId: { type: 'string', format: 'misskey:id' },
|
||||
},
|
||||
required: ['userId'],
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
@Injectable()
|
||||
export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
constructor(
|
||||
@Inject(DI.flashsRepository)
|
||||
private flashsRepository: FlashsRepository,
|
||||
|
||||
private flashEntityService: FlashEntityService,
|
||||
private queryService: QueryService,
|
||||
) {
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const query = this.queryService.makePaginationQuery(this.flashsRepository.createQueryBuilder('flash'), ps.sinceId, ps.untilId)
|
||||
.andWhere('flash.userId = :userId', { userId: ps.userId })
|
||||
.andWhere('flash.visibility = \'public\'');
|
||||
|
||||
const flashs = await query
|
||||
.limit(ps.limit)
|
||||
.getMany();
|
||||
|
||||
return await this.flashEntityService.packMany(flashs);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -148,18 +148,18 @@ export class ClientServerService {
|
|||
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {
|
||||
const token = request.cookies.token;
|
||||
if (token == null) {
|
||||
reply.code(401);
|
||||
throw new Error('login required');
|
||||
reply.code(401).send('Login required');
|
||||
return;
|
||||
}
|
||||
const user = await this.usersRepository.findOneBy({ token });
|
||||
if (user == null) {
|
||||
reply.code(403);
|
||||
throw new Error('no such user');
|
||||
reply.code(403).send('No such user');
|
||||
return;
|
||||
}
|
||||
const isAdministrator = await this.roleService.isAdministrator(user);
|
||||
if (!isAdministrator) {
|
||||
reply.code(403);
|
||||
throw new Error('access denied');
|
||||
reply.code(403).send('Access denied');
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ describe('Webリソース', () => {
|
|||
let aliceGalleryPost: any;
|
||||
let aliceChannel: any;
|
||||
|
||||
let bob: misskey.entities.MeSignup;
|
||||
|
||||
type Request = {
|
||||
path: string,
|
||||
accept?: string,
|
||||
|
|
@ -90,6 +92,8 @@ describe('Webリソース', () => {
|
|||
fileIds: [aliceUploadedFile.body.id],
|
||||
});
|
||||
aliceChannel = await channel(alice, {});
|
||||
|
||||
bob = await signup({ username: 'alice' });
|
||||
}, 1000 * 60 * 2);
|
||||
|
||||
afterAll(async () => {
|
||||
|
|
@ -163,9 +167,15 @@ describe('Webリソース', () => {
|
|||
});
|
||||
|
||||
describe.each([{ path: '/queue' }])('$path', ({ path }) => {
|
||||
test('はログインしないとGETできない。', async () => await notOk({
|
||||
path,
|
||||
status: 401,
|
||||
}));
|
||||
|
||||
test('はadminでなければGETできない。', async () => await notOk({
|
||||
path,
|
||||
status: 500, // FIXME? 403ではない。
|
||||
cookie: cookie(bob),
|
||||
status: 403,
|
||||
}));
|
||||
|
||||
test('はadminならGETできる。', async () => await ok({
|
||||
|
|
|
|||
|
|
@ -180,7 +180,8 @@ let event = $ref<{
|
|||
metadata: Record<string, string>;
|
||||
} | null>(null);
|
||||
let useCw = $ref(false);
|
||||
let showPreview = $ref(false);
|
||||
let showPreview = $ref(defaultStore.state.showPreview);
|
||||
watch($$(showPreview), () => defaultStore.set('showPreview', showPreview));
|
||||
let cw = $ref<string | null>(null);
|
||||
let localOnly = $ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
|
||||
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof misskey.noteVisibilities[number]);
|
||||
|
|
|
|||
|
|
@ -175,8 +175,13 @@ export default function(props: {
|
|||
}, genEl(token.children, scale));
|
||||
}
|
||||
case 'rainbow': {
|
||||
if (!useAnim) {
|
||||
return h('span', {
|
||||
class: '_mfm_rainbow_fallback_',
|
||||
}, genEl(token.children, scale));
|
||||
}
|
||||
const speed = validTime(token.props.args.speed) ?? '1s';
|
||||
style = useAnim ? `animation: mfm-rainbow ${speed} linear infinite;` : '';
|
||||
style = `animation: mfm-rainbow ${speed} linear infinite;`;
|
||||
break;
|
||||
}
|
||||
case 'sparkle': {
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<MkButton class="button" @click="more()">
|
||||
<i class="ti ti-reload"></i>{{ i18n.ts.more }}
|
||||
</MkButton>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
|
|
@ -124,6 +127,12 @@ async function save(announcement) {
|
|||
}
|
||||
}
|
||||
|
||||
function more() {
|
||||
os.api('admin/announcements/list', { untilId: announcements.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcementResponse => {
|
||||
announcements = announcements.concat(announcementResponse);
|
||||
});
|
||||
}
|
||||
|
||||
function refresh() {
|
||||
os.api('admin/announcements/list').then(announcementResponse => {
|
||||
announcements = announcementResponse;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkButton @click="show"><i class="ti ti-eye"></i> {{ i18n.ts.show }}</MkButton>
|
||||
<MkButton v-if="flash" danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
||||
</div>
|
||||
<MkSelect v-model="visibility">
|
||||
<template #label>{{ i18n.ts.visibility }}</template>
|
||||
<option :key="'public'" :value="'public'">{{ i18n.ts.public }}</option>
|
||||
<option :key="'private'" :value="'private'">{{ i18n.ts.private }}</option>
|
||||
</MkSelect>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
</MkStickyContainer>
|
||||
|
|
@ -36,6 +41,7 @@ import { i18n } from '@/i18n';
|
|||
import { definePageMetadata } from '@/scripts/page-metadata';
|
||||
import MkTextarea from '@/components/MkTextarea.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkSelect from '@/components/MkSelect.vue';
|
||||
import { useRouter } from '@/router';
|
||||
|
||||
const PRESET_DEFAULT = `/// @ 0.15.0
|
||||
|
|
@ -358,6 +364,7 @@ const props = defineProps<{
|
|||
}>();
|
||||
|
||||
let flash = $ref(null);
|
||||
let visibility = $ref('public');
|
||||
|
||||
if (props.id) {
|
||||
flash = await os.api('flash/show', {
|
||||
|
|
@ -402,6 +409,7 @@ async function save() {
|
|||
summary,
|
||||
permissions,
|
||||
script,
|
||||
visibility,
|
||||
});
|
||||
} else {
|
||||
const created = await os.apiWithDialog('flash/create', {
|
||||
|
|
|
|||
|
|
@ -12,18 +12,22 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.options }}</template>
|
||||
|
||||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.specifyUser }}</template>
|
||||
<template v-if="user" #suffix>@{{ user.username }}</template>
|
||||
<div class="_gaps_m">
|
||||
<MkSwitch v-model="isLocalOnly">{{ i18n.ts.localOnly }}</MkSwitch>
|
||||
|
||||
<div style="text-align: center;" class="_gaps">
|
||||
<div v-if="user">@{{ user.username }}</div>
|
||||
<div>
|
||||
<MkButton v-if="user == null" primary rounded inline @click="selectUser">{{ i18n.ts.selectUser }}</MkButton>
|
||||
<MkButton v-else danger rounded inline @click="user = null">{{ i18n.ts.remove }}</MkButton>
|
||||
<MkFolder>
|
||||
<template #label>{{ i18n.ts.specifyUser }}</template>
|
||||
<template v-if="user" #suffix>@{{ user.username }}</template>
|
||||
|
||||
<div style="text-align: center;" class="_gaps">
|
||||
<div v-if="user">@{{ user.username }}</div>
|
||||
<div>
|
||||
<MkButton v-if="user == null" primary rounded inline @click="selectUser">{{ i18n.ts.selectUser }}</MkButton>
|
||||
<MkButton v-else danger rounded inline @click="user = null">{{ i18n.ts.remove }}</MkButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</MkFolder>
|
||||
</MkFolder>
|
||||
</div>
|
||||
</MkFolder>
|
||||
<div>
|
||||
<MkButton large primary gradate rounded style="margin: 0 auto;" @click="search">{{ i18n.ts.search }}</MkButton>
|
||||
|
|
@ -43,6 +47,7 @@ import MkNotes from '@/components/MkNotes.vue';
|
|||
import MkInput from '@/components/MkInput.vue';
|
||||
import MkRadios from '@/components/MkRadios.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import { i18n } from '@/i18n';
|
||||
import * as os from '@/os';
|
||||
import MkFoldableSection from '@/components/MkFoldableSection.vue';
|
||||
|
|
@ -59,6 +64,7 @@ let searchQuery = $ref('');
|
|||
let searchOrigin = $ref('combined');
|
||||
let notePagination = $ref();
|
||||
let user = $ref(null);
|
||||
let isLocalOnly = $ref(false);
|
||||
|
||||
function selectUser() {
|
||||
os.selectUser().then(_user => {
|
||||
|
|
@ -98,6 +104,8 @@ async function search() {
|
|||
},
|
||||
};
|
||||
|
||||
if (isLocalOnly) notePagination.params.host = '.';
|
||||
|
||||
key++;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<MkSpacer :contentMax="700">
|
||||
<MkPagination v-slot="{items}" ref="list" :pagination="pagination">
|
||||
<MkFlashPreview v-for="flash in items" :key="flash.id" :flash="flash" class="_margin"/>
|
||||
</MkPagination>
|
||||
</MkSpacer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import * as misskey from 'misskey-js';
|
||||
import MkFlashPreview from '@/components/MkFlashPreview.vue';
|
||||
import MkPagination from '@/components/MkPagination.vue';
|
||||
|
||||
const props = defineProps<{
|
||||
user: misskey.entities.User;
|
||||
}>();
|
||||
|
||||
const pagination = {
|
||||
endpoint: 'users/flashs' as const,
|
||||
limit: 20,
|
||||
params: computed(() => ({
|
||||
userId: props.user.id,
|
||||
})),
|
||||
};
|
||||
</script>
|
||||
|
|
@ -17,6 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<XClips v-else-if="tab === 'clips'" :user="user"/>
|
||||
<XLists v-else-if="tab === 'lists'" :user="user"/>
|
||||
<XPages v-else-if="tab === 'pages'" :user="user"/>
|
||||
<XFlashs v-else-if="tab === 'flashs'" :user="user"/>
|
||||
<XGallery v-else-if="tab === 'gallery'" :user="user"/>
|
||||
</div>
|
||||
<MkError v-else-if="error" @retry="fetchUser()"/>
|
||||
|
|
@ -44,6 +45,7 @@ const XReactions = defineAsyncComponent(() => import('./reactions.vue'));
|
|||
const XClips = defineAsyncComponent(() => import('./clips.vue'));
|
||||
const XLists = defineAsyncComponent(() => import('./lists.vue'));
|
||||
const XPages = defineAsyncComponent(() => import('./pages.vue'));
|
||||
const XFlashs = defineAsyncComponent(() => import('./flashs.vue'));
|
||||
const XGallery = defineAsyncComponent(() => import('./gallery.vue'));
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
|
@ -109,6 +111,10 @@ const headerTabs = $computed(() => user ? [{
|
|||
key: 'pages',
|
||||
title: i18n.ts.pages,
|
||||
icon: 'ti ti-news',
|
||||
}, {
|
||||
key: 'flashs',
|
||||
title: 'Play',
|
||||
icon: 'ti ti-player-play',
|
||||
}, {
|
||||
key: 'gallery',
|
||||
title: i18n.ts.gallery,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import * as os from '@/os';
|
|||
import { $i } from '@/account';
|
||||
import { miLocalStorage } from '@/local-storage';
|
||||
import { customEmojis } from '@/custom-emojis';
|
||||
import { lang } from '@/config';
|
||||
|
||||
export function createAiScriptEnv(opts) {
|
||||
let apiRequests = 0;
|
||||
|
|
@ -16,6 +17,7 @@ export function createAiScriptEnv(opts) {
|
|||
USER_NAME: $i ? values.STR($i.name) : values.NULL,
|
||||
USER_USERNAME: $i ? values.STR($i.username) : values.NULL,
|
||||
CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value),
|
||||
LOCALE: values.STR(lang),
|
||||
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
|
||||
await os.alert({
|
||||
type: type ? type.value : 'info',
|
||||
|
|
|
|||
|
|
@ -156,7 +156,8 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
|
|||
icon: 'ti ti-mail',
|
||||
text: i18n.ts.sendMessage,
|
||||
action: () => {
|
||||
os.post({ specified: user, initialText: `@${user.username} ` });
|
||||
const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`;
|
||||
os.post({ specified: user, initialText: `${canonical} ` });
|
||||
},
|
||||
}, null, {
|
||||
icon: 'ti ti-pencil',
|
||||
|
|
|
|||
|
|
@ -135,6 +135,10 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||
where: 'deviceAccount',
|
||||
default: false,
|
||||
},
|
||||
showPreview: {
|
||||
where: 'device',
|
||||
default: false,
|
||||
},
|
||||
statusbars: {
|
||||
where: 'deviceAccount',
|
||||
default: [] as {
|
||||
|
|
|
|||
|
|
@ -527,6 +527,13 @@ hr {
|
|||
}
|
||||
}
|
||||
|
||||
._mfm_rainbow_fallback_ {
|
||||
background-image: linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 165, 0) 17%, rgb(255, 255, 0) 33%, rgb(0, 255, 0) 50%, rgb(0, 255, 255) 67%, rgb(0, 0, 255) 83%, rgb(255, 0, 255) 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
@keyframes mfm-spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
|
|
|
|||
|
|
@ -639,6 +639,7 @@ export type Endpoints = {
|
|||
'users/lists/update': { req: { listId: UserList['id']; name: string; }; res: UserList; };
|
||||
'users/notes': { req: { userId: User['id']; limit?: number; sinceId?: Note['id']; untilId?: Note['id']; sinceDate?: number; untilDate?: number; }; res: Note[]; };
|
||||
'users/pages': { req: TODO; res: TODO; };
|
||||
'users/flashs': { req: TODO; res: TODO; };
|
||||
'users/recommendation': { req: TODO; res: TODO; };
|
||||
'users/relation': { req: TODO; res: TODO; };
|
||||
'users/report-abuse': { req: TODO; res: TODO; };
|
||||
|
|
|
|||
|
|
@ -39,4 +39,8 @@ export const permissions = [
|
|||
'write:gallery',
|
||||
'read:gallery-likes',
|
||||
'write:gallery-likes',
|
||||
'read:flash',
|
||||
'write:flash',
|
||||
'read:flash-likes',
|
||||
'write:flash-likes',
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue