Merge branch 'misskey-dev:develop' into develop

This commit is contained in:
老兄 2023-08-21 17:15:06 +08:00 committed by GitHub
commit b59d47dbcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 127 additions and 34 deletions

View File

@ -159,6 +159,9 @@ id: 'aid'
#deliverJobMaxAttempts: 12 #deliverJobMaxAttempts: 12
#inboxJobMaxAttempts: 8 #inboxJobMaxAttempts: 8
# Local address used for outgoing requests
#outgoingAddress: 127.0.0.1
# IP address family used for outgoing request (ipv4, ipv6 or dual) # IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4 #outgoingAddressFamily: ipv4

View File

@ -14,7 +14,7 @@ jobs:
- run: corepack enable - run: corepack enable
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'pnpm' cache: 'pnpm'

View File

@ -19,7 +19,7 @@ jobs:
with: with:
version: 8 version: 8
run_install: false run_install: false
- uses: actions/setup-node@v3.8.0 - uses: actions/setup-node@v3.8.1
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'pnpm' cache: 'pnpm'
@ -46,7 +46,7 @@ jobs:
with: with:
version: 7 version: 7
run_install: false run_install: false
- uses: actions/setup-node@v3.8.0 - uses: actions/setup-node@v3.8.1
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'pnpm' cache: 'pnpm'
@ -72,7 +72,7 @@ jobs:
with: with:
version: 7 version: 7
run_install: false run_install: false
- uses: actions/setup-node@v3.8.0 - uses: actions/setup-node@v3.8.1
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'pnpm' cache: 'pnpm'

View File

@ -38,7 +38,7 @@ jobs:
version: 8 version: 8
run_install: false run_install: false
- name: Use Node.js 20.x - name: Use Node.js 20.x
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version-file: '.node-version' node-version-file: '.node-version'
cache: 'pnpm' cache: 'pnpm'

View File

@ -38,7 +38,7 @@ jobs:
version: 8 version: 8
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: 'pnpm' cache: 'pnpm'

View File

@ -25,7 +25,7 @@ jobs:
version: 8 version: 8
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: 'pnpm' cache: 'pnpm'
@ -83,7 +83,7 @@ jobs:
version: 7 version: 7
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: 'pnpm' cache: 'pnpm'

View File

@ -26,7 +26,7 @@ jobs:
- run: corepack enable - run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }} - name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: 'pnpm' cache: 'pnpm'

View File

@ -28,7 +28,7 @@ jobs:
version: 8 version: 8
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0 uses: actions/setup-node@v3.8.1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}
cache: 'pnpm' cache: 'pnpm'

View File

@ -12,7 +12,7 @@
--> -->
## 2023.8.0 (unreleased) ## 2023.9.0 (unreleased)
### General ### General
- OAuth 2.0のサポート - OAuth 2.0のサポート
@ -27,18 +27,26 @@
- 絵文字ピッカーの検索の表示件数を100件に増加 - 絵文字ピッカーの検索の表示件数を100件に増加
- Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように - Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように
- Enhance: 自分が押したリアクションのデザインを改善 - Enhance: 自分が押したリアクションのデザインを改善
- Enhance: ノート検索にローカルのみ検索可能なオプションの追加
- Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正 - Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正 - Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正 - Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正
- Fix: word mute for sub note is not applied - Fix: word mute for sub note is not applied
- Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正 - Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正
- Fix: Misskeyプラグインをインストールする際のAiScriptバージョンのチェックが0.14.0以降に対応していない問題を修正 - Fix: Misskeyプラグインをインストールする際のAiScriptバージョンのチェックが0.14.0以降に対応していない問題を修正
- Fix: 他のサーバーのユーザーへ「メッセージを送信」した時の初期テキストのメンションが間違っている問題を修正
- Playの操作を行うAPI TokenをAPIコンソールから発行できるように
### Server ### Server
- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように
- cacheRemoteFilesの初期値はfalseになりました - cacheRemoteFilesの初期値はfalseになりました
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善 - ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
- Webhookのペイロードにサーバーのurlが含まれるようになりました
- Fix: 一部のfeatured noteを照会できない問題を修正 - Fix: 一部のfeatured noteを照会できない問題を修正
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正 - Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
- Fix: ジョブキュー管理画面の認証を回避できる問題を修正
- Fix: 一部のサーバー内部エラーがスタックトレースを返さないように修正
## 13.14.2 ## 13.14.2
@ -53,6 +61,7 @@
### Server ### Server
- Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正 - Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正
- Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正 - Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正
- Enhance: Add address bind config option (outgoingAddress)
## 13.14.1 ## 13.14.1

4
locales/index.d.ts vendored
View File

@ -1862,6 +1862,10 @@ export interface Locale {
"write:gallery": string; "write:gallery": string;
"read:gallery-likes": string; "read:gallery-likes": string;
"write:gallery-likes": string; "write:gallery-likes": string;
"read:flash": string;
"write:flash": string;
"read:flash-likes": string;
"write:flash-likes": string;
}; };
"_auth": { "_auth": {
"shareAccessTitle": string; "shareAccessTitle": string;

View File

@ -1780,6 +1780,10 @@ _permissions:
"write:gallery": "ギャラリーを操作する" "write:gallery": "ギャラリーを操作する"
"read:gallery-likes": "ギャラリーのいいねを見る" "read:gallery-likes": "ギャラリーのいいねを見る"
"write:gallery-likes": "ギャラリーのいいねを操作する" "write:gallery-likes": "ギャラリーのいいねを操作する"
"read:flash": "Playを見る"
"write:flash": "Playを操作する"
"read:flash-likes": "Playのいいねを見る"
"write:flash-likes": "Playのいいねを操作する"
_auth: _auth:
shareAccessTitle: "アプリへのアクセス許可" shareAccessTitle: "アプリへのアクセス許可"

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "13.14.2", "version": "2023.9.0-beta.1",
"codename": "nasubi", "codename": "nasubi",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -16,5 +16,9 @@ export class addRenoteMuting1665091090561 {
} }
async down(queryRunner) { async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_renote_muting_muterId"`);
await queryRunner.query(`DROP INDEX "IDX_renote_muting_muteeId"`);
await queryRunner.query(`DROP INDEX "IDX_renote_muting_createdAt"`);
await queryRunner.query(`DROP TABLE "renote_muting"`);
} }
} }

View File

@ -0,0 +1,12 @@
export class FixRenoteMuting1690417561185 {
name = 'FixRenoteMuting1690417561185'
async up(queryRunner) {
await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muteeId" NOT IN (SELECT "id" FROM "user")`);
await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muterId" NOT IN (SELECT "id" FROM "user")`);
}
async down(queryRunner) {
}
}

View File

@ -76,6 +76,7 @@ export type Source = {
id: string; id: string;
outgoingAddress?: string;
outgoingAddressFamily?: 'ipv4' | 'ipv6' | 'dual'; outgoingAddressFamily?: 'ipv4' | 'ipv6' | 'dual';
deliverJobConcurrency?: number; deliverJobConcurrency?: number;

View File

@ -53,12 +53,14 @@ export class HttpRequestService {
keepAlive: true, keepAlive: true,
keepAliveMsecs: 30 * 1000, keepAliveMsecs: 30 * 1000,
lookup: cache.lookup as unknown as net.LookupFunction, lookup: cache.lookup as unknown as net.LookupFunction,
localAddress: config.outgoingAddress,
}); });
this.https = new https.Agent({ this.https = new https.Agent({
keepAlive: true, keepAlive: true,
keepAliveMsecs: 30 * 1000, keepAliveMsecs: 30 * 1000,
lookup: cache.lookup as unknown as net.LookupFunction, lookup: cache.lookup as unknown as net.LookupFunction,
localAddress: config.outgoingAddress,
}); });
const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128); const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128);
@ -71,6 +73,7 @@ export class HttpRequestService {
maxFreeSockets: 256, maxFreeSockets: 256,
scheduling: 'lifo', scheduling: 'lifo',
proxy: config.proxy, proxy: config.proxy,
localAddress: config.outgoingAddress,
}) })
: this.http; : this.http;
@ -82,6 +85,7 @@ export class HttpRequestService {
maxFreeSockets: 256, maxFreeSockets: 256,
scheduling: 'lifo', scheduling: 'lifo',
proxy: config.proxy, proxy: config.proxy,
localAddress: config.outgoingAddress,
}) })
: this.https; : this.https;
} }

View File

@ -25,6 +25,8 @@ type Q =
{ op: '<', k: K, v: number } | { op: '<', k: K, v: number } |
{ op: '>=', k: K, v: number } | { 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: 'and', qs: Q[] } |
{ op: 'or', qs: Q[] } | { op: 'or', qs: Q[] } |
{ op: 'not', q: Q }; { op: 'not', q: Q };
@ -50,6 +52,8 @@ function compileQuery(q: Q): string {
case '<=': return `(${q.k} <= ${compileValue(q.v)})`; case '<=': return `(${q.k} <= ${compileValue(q.v)})`;
case 'and': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' AND ') })`; 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 '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)})`; case 'not': return `(NOT ${compileQuery(q.q)})`;
default: throw new Error('unrecognized query operator'); 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.channelId) filter.qs.push({ op: '=', k: 'channelId', v: opts.channelId });
if (opts.host) { if (opts.host) {
if (opts.host === '.') { if (opts.host === '.') {
// TODO: Meilisearchが2023/05/07現在値がNULLかどうかのクエリが書けない filter.qs.push({ op: 'is null', k: 'userHost' });
} else { } else {
filter.qs.push({ op: '=', k: 'userHost', v: opts.host }); filter.qs.push({ op: '=', k: 'userHost', v: opts.host });
} }
@ -204,6 +208,14 @@ export class SearchService {
.leftJoinAndSelect('reply.user', 'replyUser') .leftJoinAndSelect('reply.user', 'replyUser')
.leftJoinAndSelect('renote.user', 'renoteUser'); .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); this.queryService.generateVisibilityQuery(query, me);
if (me) this.queryService.generateMutedUserQuery(query, me); if (me) this.queryService.generateMutedUserQuery(query, me);
if (me) this.queryService.generateBlockedUserQuery(query, me); if (me) this.queryService.generateBlockedUserQuery(query, me);

View File

@ -47,6 +47,7 @@ export class WebhookDeliverProcessorService {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
body: JSON.stringify({ body: JSON.stringify({
server: this.config.url,
hookId: job.data.webhookId, hookId: job.data.webhookId,
userId: job.data.userId, userId: job.data.userId,
eventId: job.data.eventId, eventId: job.data.eventId,

View File

@ -85,8 +85,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private globalEventService: GlobalEventService, private globalEventService: GlobalEventService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
if ((ps.keywords.length === 0) || ps.keywords[0].every(x => x === '')) { if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
throw new Error('invalid param'); throw new Error('either keywords or excludeKeywords is required.');
} }
const currentAntennasCount = await this.antennasRepository.countBy({ const currentAntennasCount = await this.antennasRepository.countBy({

View File

@ -82,6 +82,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private globalEventService: GlobalEventService, private globalEventService: GlobalEventService,
) { ) {
super(meta, paramDef, async (ps, me) => { 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 // Fetch the antenna
const antenna = await this.antennasRepository.findOneBy({ const antenna = await this.antennasRepository.findOneBy({
id: ps.antennaId, id: ps.antennaId,

View File

@ -143,21 +143,23 @@ export class ClientServerService {
// Authenticate // Authenticate
fastify.addHook('onRequest', async (request, reply) => { fastify.addHook('onRequest', async (request, reply) => {
if (request.url === bullBoardPath || request.url.startsWith(bullBoardPath + '/')) { // %71ueueとかでリクエストされたら困るため
const url = decodeURI(request.url);
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {
const token = request.cookies.token; const token = request.cookies.token;
if (token == null) { if (token == null) {
reply.code(401); reply.code(401).send('Login required');
throw new Error('login required'); return;
} }
const user = await this.usersRepository.findOneBy({ token }); const user = await this.usersRepository.findOneBy({ token });
if (user == null) { if (user == null) {
reply.code(403); reply.code(403).send('No such user');
throw new Error('no such user'); return;
} }
const isAdministrator = await this.roleService.isAdministrator(user); const isAdministrator = await this.roleService.isAdministrator(user);
if (!isAdministrator) { if (!isAdministrator) {
reply.code(403); reply.code(403).send('Access denied');
throw new Error('access denied'); return;
} }
} }
}); });

View File

@ -34,6 +34,8 @@ describe('Webリソース', () => {
let aliceGalleryPost: any; let aliceGalleryPost: any;
let aliceChannel: any; let aliceChannel: any;
let bob: misskey.entities.MeSignup;
type Request = { type Request = {
path: string, path: string,
accept?: string, accept?: string,
@ -90,6 +92,8 @@ describe('Webリソース', () => {
fileIds: [aliceUploadedFile.body.id], fileIds: [aliceUploadedFile.body.id],
}); });
aliceChannel = await channel(alice, {}); aliceChannel = await channel(alice, {});
bob = await signup({ username: 'alice' });
}, 1000 * 60 * 2); }, 1000 * 60 * 2);
afterAll(async () => { afterAll(async () => {
@ -163,9 +167,15 @@ describe('Webリソース', () => {
}); });
describe.each([{ path: '/queue' }])('$path', ({ path }) => { describe.each([{ path: '/queue' }])('$path', ({ path }) => {
test('はログインしないとGETできない。', async () => await notOk({
path,
status: 401,
}));
test('はadminでなければGETできない。', async () => await notOk({ test('はadminでなければGETできない。', async () => await notOk({
path, path,
status: 500, // FIXME? 403ではない。 cookie: cookie(bob),
status: 403,
})); }));
test('はadminならGETできる。', async () => await ok({ test('はadminならGETできる。', async () => await ok({

View File

@ -57,6 +57,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
</div> </div>
</MkFolder> </MkFolder>
<MkButton class="button" @click="more()">
<i class="ti ti-reload"></i>{{ i18n.ts.more }}
</MkButton>
</div> </div>
</MkSpacer> </MkSpacer>
</MkStickyContainer> </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() { function refresh() {
os.api('admin/announcements/list').then(announcementResponse => { os.api('admin/announcements/list').then(announcementResponse => {
announcements = announcementResponse; announcements = announcementResponse;

View File

@ -12,18 +12,22 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder> <MkFolder>
<template #label>{{ i18n.ts.options }}</template> <template #label>{{ i18n.ts.options }}</template>
<MkFolder> <div class="_gaps_m">
<template #label>{{ i18n.ts.specifyUser }}</template> <MkSwitch v-model="isLocalOnly">{{ i18n.ts.localOnly }}</MkSwitch>
<template v-if="user" #suffix>@{{ user.username }}</template>
<div style="text-align: center;" class="_gaps"> <MkFolder>
<div v-if="user">@{{ user.username }}</div> <template #label>{{ i18n.ts.specifyUser }}</template>
<div> <template v-if="user" #suffix>@{{ user.username }}</template>
<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 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>
</div> </MkFolder>
</MkFolder> </div>
</MkFolder> </MkFolder>
<div> <div>
<MkButton large primary gradate rounded style="margin: 0 auto;" @click="search">{{ i18n.ts.search }}</MkButton> <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 MkInput from '@/components/MkInput.vue';
import MkRadios from '@/components/MkRadios.vue'; import MkRadios from '@/components/MkRadios.vue';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import * as os from '@/os'; import * as os from '@/os';
import MkFoldableSection from '@/components/MkFoldableSection.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue';
@ -59,6 +64,7 @@ let searchQuery = $ref('');
let searchOrigin = $ref('combined'); let searchOrigin = $ref('combined');
let notePagination = $ref(); let notePagination = $ref();
let user = $ref(null); let user = $ref(null);
let isLocalOnly = $ref(false);
function selectUser() { function selectUser() {
os.selectUser().then(_user => { os.selectUser().then(_user => {
@ -98,6 +104,8 @@ async function search() {
}, },
}; };
if (isLocalOnly) notePagination.params.host = '.';
key++; key++;
} }
</script> </script>

View File

@ -8,6 +8,7 @@ import * as os from '@/os';
import { $i } from '@/account'; import { $i } from '@/account';
import { miLocalStorage } from '@/local-storage'; import { miLocalStorage } from '@/local-storage';
import { customEmojis } from '@/custom-emojis'; import { customEmojis } from '@/custom-emojis';
import { lang } from '@/config';
export function createAiScriptEnv(opts) { export function createAiScriptEnv(opts) {
let apiRequests = 0; let apiRequests = 0;
@ -16,6 +17,7 @@ export function createAiScriptEnv(opts) {
USER_NAME: $i ? values.STR($i.name) : values.NULL, USER_NAME: $i ? values.STR($i.name) : values.NULL,
USER_USERNAME: $i ? values.STR($i.username) : values.NULL, USER_USERNAME: $i ? values.STR($i.username) : values.NULL,
CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value), CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value),
LOCALE: values.STR(lang),
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
await os.alert({ await os.alert({
type: type ? type.value : 'info', type: type ? type.value : 'info',

View File

@ -156,7 +156,8 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
icon: 'ti ti-mail', icon: 'ti ti-mail',
text: i18n.ts.sendMessage, text: i18n.ts.sendMessage,
action: () => { 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, { }, null, {
icon: 'ti ti-pencil', icon: 'ti ti-pencil',

View File

@ -39,4 +39,8 @@ export const permissions = [
'write:gallery', 'write:gallery',
'read:gallery-likes', 'read:gallery-likes',
'write:gallery-likes', 'write:gallery-likes',
'read:flash',
'write:flash',
'read:flash-likes',
'write:flash-likes',
]; ];