Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09dfb9bde3 | |||
| b0714cbd7b | |||
| d0917aac1a | |||
| ff6600da2e | |||
| 7e74cff126 | |||
| e53749773e | |||
| 392de4df36 | |||
| cc6a96e1c9 | |||
| 0e681f3cc4 | |||
| a512915a84 | |||
| 5edc885c22 | |||
| e5c339b86a | |||
| d92e2b6ae0 |
@@ -12,6 +12,19 @@
|
|||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 2023.9.3
|
||||||
|
### General
|
||||||
|
- Enhance: ノートの翻訳機能の利用可否をロールで設定可能に
|
||||||
|
|
||||||
|
### Client
|
||||||
|
- Enhance: AiScriptでホストのアドレスを参照する定数`SERVER_URL`を追加
|
||||||
|
- Enhance: モデレーションログ機能の強化
|
||||||
|
- Enhance: ローカリゼーションの更新
|
||||||
|
|
||||||
|
### Server
|
||||||
|
- Fix: Redisに古いバージョンのキャッシュが残っている場合、キャッシュが消えるまでの間通知が届かなくなる問題を修正
|
||||||
|
- Fix: 後方互換性の修正
|
||||||
|
|
||||||
## 2023.9.2
|
## 2023.9.2
|
||||||
|
|
||||||
### General
|
### General
|
||||||
@@ -20,6 +33,7 @@
|
|||||||
- Feat: 通知を種類ごとに 全員から受け取る/フォロー中のユーザーのみ受け取る/フォロワーのみ受け取る/相互のみ受け取る/指定したリストのメンバーのみ受け取る/受け取らない から選べるように
|
- Feat: 通知を種類ごとに 全員から受け取る/フォロー中のユーザーのみ受け取る/フォロワーのみ受け取る/相互のみ受け取る/指定したリストのメンバーのみ受け取る/受け取らない から選べるように
|
||||||
- Enhance: タイムラインからRenoteを除外するオプションを追加
|
- Enhance: タイムラインからRenoteを除外するオプションを追加
|
||||||
- Enhance: ユーザーページのノート一覧でRenoteを除外できるように
|
- Enhance: ユーザーページのノート一覧でRenoteを除外できるように
|
||||||
|
- Enhance: タイムラインでファイルが添付されたノートのみ表示するオプションを追加
|
||||||
- Enhance: モデレーションログ機能の強化
|
- Enhance: モデレーションログ機能の強化
|
||||||
- Enhance: 依存関係の更新
|
- Enhance: 依存関係の更新
|
||||||
- Enhance: ローカリゼーションの更新
|
- Enhance: ローカリゼーションの更新
|
||||||
|
|||||||
Vendored
+2
@@ -1128,6 +1128,7 @@ export interface Locale {
|
|||||||
"edited": string;
|
"edited": string;
|
||||||
"notificationRecieveConfig": string;
|
"notificationRecieveConfig": string;
|
||||||
"mutualFollow": string;
|
"mutualFollow": string;
|
||||||
|
"fileAttachedOnly": string;
|
||||||
"_announcement": {
|
"_announcement": {
|
||||||
"forExistingUsers": string;
|
"forExistingUsers": string;
|
||||||
"forExistingUsersDescription": string;
|
"forExistingUsersDescription": string;
|
||||||
@@ -1561,6 +1562,7 @@ export interface Locale {
|
|||||||
"descriptionOfRateLimitFactor": string;
|
"descriptionOfRateLimitFactor": string;
|
||||||
"canHideAds": string;
|
"canHideAds": string;
|
||||||
"canSearchNotes": string;
|
"canSearchNotes": string;
|
||||||
|
"canUseTranslator": string;
|
||||||
};
|
};
|
||||||
"_condition": {
|
"_condition": {
|
||||||
"isLocal": string;
|
"isLocal": string;
|
||||||
|
|||||||
+3
-1
@@ -1125,6 +1125,7 @@ showRenotes: "リノートを表示"
|
|||||||
edited: "編集済み"
|
edited: "編集済み"
|
||||||
notificationRecieveConfig: "通知の受信設定"
|
notificationRecieveConfig: "通知の受信設定"
|
||||||
mutualFollow: "相互フォロー"
|
mutualFollow: "相互フォロー"
|
||||||
|
fileAttachedOnly: "ファイル付きのみ"
|
||||||
|
|
||||||
_announcement:
|
_announcement:
|
||||||
forExistingUsers: "既存ユーザーのみ"
|
forExistingUsers: "既存ユーザーのみ"
|
||||||
@@ -1481,7 +1482,8 @@ _role:
|
|||||||
rateLimitFactor: "レートリミット"
|
rateLimitFactor: "レートリミット"
|
||||||
descriptionOfRateLimitFactor: "小さいほど制限が緩和され、大きいほど制限が強化されます。"
|
descriptionOfRateLimitFactor: "小さいほど制限が緩和され、大きいほど制限が強化されます。"
|
||||||
canHideAds: "広告の非表示"
|
canHideAds: "広告の非表示"
|
||||||
canSearchNotes: "ノート検索の利用可否"
|
canSearchNotes: "ノート検索の利用"
|
||||||
|
canUseTranslator: "翻訳機能の利用"
|
||||||
_condition:
|
_condition:
|
||||||
isLocal: "ローカルユーザー"
|
isLocal: "ローカルユーザー"
|
||||||
isRemote: "リモートユーザー"
|
isRemote: "リモートユーザー"
|
||||||
|
|||||||
+1
-1
@@ -1125,7 +1125,7 @@ showRenotes: "显示转帖"
|
|||||||
edited: "已编辑"
|
edited: "已编辑"
|
||||||
notificationRecieveConfig: "通知接收设置"
|
notificationRecieveConfig: "通知接收设置"
|
||||||
mutualFollow: "互相关注"
|
mutualFollow: "互相关注"
|
||||||
fileAttachedOnly: "仅添加文件"
|
fileAttachedOnly: "仅限媒体"
|
||||||
_announcement:
|
_announcement:
|
||||||
forExistingUsers: "仅限现有用户"
|
forExistingUsers: "仅限现有用户"
|
||||||
forExistingUsersDescription: "若启用,该公告将仅对创建此公告时存在的用户可见。 如果禁用,则在创建此公告后注册的用户也可以看到该公告。"
|
forExistingUsersDescription: "若启用,该公告将仅对创建此公告时存在的用户可见。 如果禁用,则在创建此公告后注册的用户也可以看到该公告。"
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "misskey",
|
"name": "misskey",
|
||||||
"version": "2023.9.2",
|
"version": "2023.9.3",
|
||||||
"codename": "nasubi",
|
"codename": "nasubi",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -80,7 +80,10 @@ export class NotificationService implements OnApplicationShutdown {
|
|||||||
notifierId?: MiUser['id'] | null,
|
notifierId?: MiUser['id'] | null,
|
||||||
): Promise<MiNotification | null> {
|
): Promise<MiNotification | null> {
|
||||||
const profile = await this.cacheService.userProfileCache.fetch(notifieeId);
|
const profile = await this.cacheService.userProfileCache.fetch(notifieeId);
|
||||||
const recieveConfig = profile.notificationRecieveConfig[type];
|
|
||||||
|
// 古いMisskeyバージョンのキャッシュが残っている可能性がある
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
|
const recieveConfig = (profile.notificationRecieveConfig ?? {})[type];
|
||||||
if (recieveConfig?.type === 'never') {
|
if (recieveConfig?.type === 'never') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export type RolePolicies = {
|
|||||||
inviteExpirationTime: number;
|
inviteExpirationTime: number;
|
||||||
canManageCustomEmojis: boolean;
|
canManageCustomEmojis: boolean;
|
||||||
canSearchNotes: boolean;
|
canSearchNotes: boolean;
|
||||||
|
canUseTranslator: boolean;
|
||||||
canHideAds: boolean;
|
canHideAds: boolean;
|
||||||
driveCapacityMb: number;
|
driveCapacityMb: number;
|
||||||
alwaysMarkNsfw: boolean;
|
alwaysMarkNsfw: boolean;
|
||||||
@@ -58,6 +59,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
|
|||||||
inviteExpirationTime: 0,
|
inviteExpirationTime: 0,
|
||||||
canManageCustomEmojis: false,
|
canManageCustomEmojis: false,
|
||||||
canSearchNotes: false,
|
canSearchNotes: false,
|
||||||
|
canUseTranslator: true,
|
||||||
canHideAds: false,
|
canHideAds: false,
|
||||||
driveCapacityMb: 100,
|
driveCapacityMb: 100,
|
||||||
alwaysMarkNsfw: false,
|
alwaysMarkNsfw: false,
|
||||||
@@ -303,6 +305,7 @@ export class RoleService implements OnApplicationShutdown {
|
|||||||
inviteExpirationTime: calc('inviteExpirationTime', vs => Math.max(...vs)),
|
inviteExpirationTime: calc('inviteExpirationTime', vs => Math.max(...vs)),
|
||||||
canManageCustomEmojis: calc('canManageCustomEmojis', vs => vs.some(v => v === true)),
|
canManageCustomEmojis: calc('canManageCustomEmojis', vs => vs.some(v => v === true)),
|
||||||
canSearchNotes: calc('canSearchNotes', vs => vs.some(v => v === true)),
|
canSearchNotes: calc('canSearchNotes', vs => vs.some(v => v === true)),
|
||||||
|
canUseTranslator: calc('canUseTranslator', vs => vs.some(v => v === true)),
|
||||||
canHideAds: calc('canHideAds', vs => vs.some(v => v === true)),
|
canHideAds: calc('canHideAds', vs => vs.some(v => v === true)),
|
||||||
driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)),
|
driveCapacityMb: calc('driveCapacityMb', vs => Math.max(...vs)),
|
||||||
alwaysMarkNsfw: calc('alwaysMarkNsfw', vs => vs.some(v => v === true)),
|
alwaysMarkNsfw: calc('alwaysMarkNsfw', vs => vs.some(v => v === true)),
|
||||||
|
|||||||
@@ -452,6 +452,7 @@ export class UserEntityService implements OnModuleInit {
|
|||||||
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
hasPendingReceivedFollowRequest: this.getHasPendingReceivedFollowRequest(user.id),
|
||||||
mutedWords: profile!.mutedWords,
|
mutedWords: profile!.mutedWords,
|
||||||
mutedInstances: profile!.mutedInstances,
|
mutedInstances: profile!.mutedInstances,
|
||||||
|
mutingNotificationTypes: [], // 後方互換性のため
|
||||||
notificationRecieveConfig: profile!.notificationRecieveConfig,
|
notificationRecieveConfig: profile!.notificationRecieveConfig,
|
||||||
emailNotificationTypes: profile!.emailNotificationTypes,
|
emailNotificationTypes: profile!.emailNotificationTypes,
|
||||||
achievements: profile!.achievements,
|
achievements: profile!.achievements,
|
||||||
|
|||||||
@@ -34,10 +34,11 @@ describe('api:notes/create', () => {
|
|||||||
.toBe(VALID);
|
.toBe(VALID);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('null post', () => {
|
// TODO
|
||||||
expect(v({ text: null }))
|
//test('null post', () => {
|
||||||
.toBe(INVALID);
|
// expect(v({ text: null }))
|
||||||
});
|
// .toBe(INVALID);
|
||||||
|
//});
|
||||||
|
|
||||||
test('0 characters post', () => {
|
test('0 characters post', () => {
|
||||||
expect(v({ text: '' }))
|
expect(v({ text: '' }))
|
||||||
|
|||||||
@@ -10,12 +10,13 @@ import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
|||||||
import { MetaService } from '@/core/MetaService.js';
|
import { MetaService } from '@/core/MetaService.js';
|
||||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||||
import { GetterService } from '@/server/api/GetterService.js';
|
import { GetterService } from '@/server/api/GetterService.js';
|
||||||
|
import { RoleService } from '@/core/RoleService.js';
|
||||||
import { ApiError } from '../../error.js';
|
import { ApiError } from '../../error.js';
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ['notes'],
|
tags: ['notes'],
|
||||||
|
|
||||||
requireCredential: false,
|
requireCredential: true,
|
||||||
|
|
||||||
res: {
|
res: {
|
||||||
type: 'object',
|
type: 'object',
|
||||||
@@ -23,6 +24,11 @@ export const meta = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
errors: {
|
errors: {
|
||||||
|
unavailable: {
|
||||||
|
message: 'Translate of notes unavailable.',
|
||||||
|
code: 'UNAVAILABLE',
|
||||||
|
id: '50a70314-2d8a-431b-b433-efa5cc56444c',
|
||||||
|
},
|
||||||
noSuchNote: {
|
noSuchNote: {
|
||||||
message: 'No such note.',
|
message: 'No such note.',
|
||||||
code: 'NO_SUCH_NOTE',
|
code: 'NO_SUCH_NOTE',
|
||||||
@@ -47,14 +53,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||||||
private getterService: GetterService,
|
private getterService: GetterService,
|
||||||
private metaService: MetaService,
|
private metaService: MetaService,
|
||||||
private httpRequestService: HttpRequestService,
|
private httpRequestService: HttpRequestService,
|
||||||
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
|
const policies = await this.roleService.getUserPolicies(me.id);
|
||||||
|
if (!policies.canUseTranslator) {
|
||||||
|
throw new ApiError(meta.errors.unavailable);
|
||||||
|
}
|
||||||
|
|
||||||
const note = await this.getterService.getNote(ps.noteId).catch(err => {
|
const note = await this.getterService.getNote(ps.noteId).catch(err => {
|
||||||
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
|
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!(await this.noteEntityService.isVisibleForMe(note, me ? me.id : null))) {
|
if (!(await this.noteEntityService.isVisibleForMe(note, me.id))) {
|
||||||
return 204; // TODO: 良い感じのエラー返す
|
return 204; // TODO: 良い感じのエラー返す
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ describe('ユーザー', () => {
|
|||||||
unreadAnnouncements: user.unreadAnnouncements,
|
unreadAnnouncements: user.unreadAnnouncements,
|
||||||
mutedWords: user.mutedWords,
|
mutedWords: user.mutedWords,
|
||||||
mutedInstances: user.mutedInstances,
|
mutedInstances: user.mutedInstances,
|
||||||
|
mutingNotificationTypes: user.mutingNotificationTypes,
|
||||||
notificationRecieveConfig: user.notificationRecieveConfig,
|
notificationRecieveConfig: user.notificationRecieveConfig,
|
||||||
emailNotificationTypes: user.emailNotificationTypes,
|
emailNotificationTypes: user.emailNotificationTypes,
|
||||||
achievements: user.achievements,
|
achievements: user.achievements,
|
||||||
@@ -414,6 +415,7 @@ describe('ユーザー', () => {
|
|||||||
assert.deepStrictEqual(response.unreadAnnouncements, []);
|
assert.deepStrictEqual(response.unreadAnnouncements, []);
|
||||||
assert.deepStrictEqual(response.mutedWords, []);
|
assert.deepStrictEqual(response.mutedWords, []);
|
||||||
assert.deepStrictEqual(response.mutedInstances, []);
|
assert.deepStrictEqual(response.mutedInstances, []);
|
||||||
|
assert.deepStrictEqual(response.mutingNotificationTypes, []);
|
||||||
assert.deepStrictEqual(response.notificationRecieveConfig, {});
|
assert.deepStrictEqual(response.notificationRecieveConfig, {});
|
||||||
assert.deepStrictEqual(response.emailNotificationTypes, ['follow', 'receiveFollowRequest']);
|
assert.deepStrictEqual(response.emailNotificationTypes, ['follow', 'receiveFollowRequest']);
|
||||||
assert.deepStrictEqual(response.achievements, []);
|
assert.deepStrictEqual(response.achievements, []);
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ const props = withDefaults(defineProps<{
|
|||||||
sound?: boolean;
|
sound?: boolean;
|
||||||
withRenotes?: boolean;
|
withRenotes?: boolean;
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
|
onlyFiles?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
withRenotes: true,
|
withRenotes: true,
|
||||||
withReplies: false,
|
withReplies: false,
|
||||||
|
onlyFiles: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -69,10 +71,12 @@ if (props.src === 'antenna') {
|
|||||||
query = {
|
query = {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
};
|
};
|
||||||
connection = stream.useChannel('homeTimeline', {
|
connection = stream.useChannel('homeTimeline', {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
});
|
});
|
||||||
connection.on('note', prepend);
|
connection.on('note', prepend);
|
||||||
|
|
||||||
@@ -82,10 +86,12 @@ if (props.src === 'antenna') {
|
|||||||
query = {
|
query = {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
};
|
};
|
||||||
connection = stream.useChannel('localTimeline', {
|
connection = stream.useChannel('localTimeline', {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
});
|
});
|
||||||
connection.on('note', prepend);
|
connection.on('note', prepend);
|
||||||
} else if (props.src === 'social') {
|
} else if (props.src === 'social') {
|
||||||
@@ -93,10 +99,12 @@ if (props.src === 'antenna') {
|
|||||||
query = {
|
query = {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
};
|
};
|
||||||
connection = stream.useChannel('hybridTimeline', {
|
connection = stream.useChannel('hybridTimeline', {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
});
|
});
|
||||||
connection.on('note', prepend);
|
connection.on('note', prepend);
|
||||||
} else if (props.src === 'global') {
|
} else if (props.src === 'global') {
|
||||||
@@ -104,10 +112,12 @@ if (props.src === 'antenna') {
|
|||||||
query = {
|
query = {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
};
|
};
|
||||||
connection = stream.useChannel('globalTimeline', {
|
connection = stream.useChannel('globalTimeline', {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
});
|
});
|
||||||
connection.on('note', prepend);
|
connection.on('note', prepend);
|
||||||
} else if (props.src === 'mentions') {
|
} else if (props.src === 'mentions') {
|
||||||
@@ -131,11 +141,13 @@ if (props.src === 'antenna') {
|
|||||||
query = {
|
query = {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
listId: props.list,
|
listId: props.list,
|
||||||
};
|
};
|
||||||
connection = stream.useChannel('userList', {
|
connection = stream.useChannel('userList', {
|
||||||
withRenotes: props.withRenotes,
|
withRenotes: props.withRenotes,
|
||||||
withReplies: props.withReplies,
|
withReplies: props.withReplies,
|
||||||
|
withFiles: props.onlyFiles ? true : undefined,
|
||||||
listId: props.list,
|
listId: props.list,
|
||||||
});
|
});
|
||||||
connection.on('note', prepend);
|
connection.on('note', prepend);
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export const ROLE_POLICIES = [
|
|||||||
'inviteExpirationTime',
|
'inviteExpirationTime',
|
||||||
'canManageCustomEmojis',
|
'canManageCustomEmojis',
|
||||||
'canSearchNotes',
|
'canSearchNotes',
|
||||||
|
'canUseTranslator',
|
||||||
'canHideAds',
|
'canHideAds',
|
||||||
'driveCapacityMb',
|
'driveCapacityMb',
|
||||||
'alwaysMarkNsfw',
|
'alwaysMarkNsfw',
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<span v-else-if="log.type === 'suspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
<span v-else-if="log.type === 'suspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||||
<span v-else-if="log.type === 'unsuspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
<span v-else-if="log.type === 'unsuspend'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||||
<span v-else-if="log.type === 'resetPassword'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
<span v-else-if="log.type === 'resetPassword'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
||||||
<span v-else-if="log.type === 'assignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
<span v-else-if="log.type === 'assignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} <i class="ti ti-arrow-right"></i> {{ log.info.roleName }}</span>
|
||||||
<span v-else-if="log.type === 'unassignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }}</span>
|
<span v-else-if="log.type === 'unassignRole'">: @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} <i class="ti ti-equal-not"></i> {{ log.info.roleName }}</span>
|
||||||
<span v-else-if="log.type === 'createRole'">: {{ log.info.role.name }}</span>
|
<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 === 'updateRole'">: {{ log.info.before.name }}</span>
|
||||||
<span v-else-if="log.type === 'deleteRole'">: {{ log.info.role.name }}</span>
|
<span v-else-if="log.type === 'deleteRole'">: {{ log.info.role.name }}</span>
|
||||||
|
|||||||
@@ -299,6 +299,26 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
|
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseTranslator, 'canUseTranslator'])">
|
||||||
|
<template #label>{{ i18n.ts._role._options.canUseTranslator }}</template>
|
||||||
|
<template #suffix>
|
||||||
|
<span v-if="role.policies.canUseTranslator.useDefault" :class="$style.useDefaultLabel">{{ i18n.ts._role.useBaseValue }}</span>
|
||||||
|
<span v-else>{{ role.policies.canUseTranslator.value ? i18n.ts.yes : i18n.ts.no }}</span>
|
||||||
|
<span :class="$style.priorityIndicator"><i :class="getPriorityIcon(role.policies.canUseTranslator)"></i></span>
|
||||||
|
</template>
|
||||||
|
<div class="_gaps">
|
||||||
|
<MkSwitch v-model="role.policies.canUseTranslator.useDefault" :readonly="readonly">
|
||||||
|
<template #label>{{ i18n.ts._role.useBaseValue }}</template>
|
||||||
|
</MkSwitch>
|
||||||
|
<MkSwitch v-model="role.policies.canUseTranslator.value" :disabled="role.policies.canUseTranslator.useDefault" :readonly="readonly">
|
||||||
|
<template #label>{{ i18n.ts.enable }}</template>
|
||||||
|
</MkSwitch>
|
||||||
|
<MkRange v-model="role.policies.canUseTranslator.priority" :min="0" :max="2" :step="1" easing :textConverter="(v) => v === 0 ? i18n.ts._role._priority.low : v === 1 ? i18n.ts._role._priority.middle : v === 2 ? i18n.ts._role._priority.high : ''">
|
||||||
|
<template #label>{{ i18n.ts._role.priority }}</template>
|
||||||
|
</MkRange>
|
||||||
|
</div>
|
||||||
|
</MkFolder>
|
||||||
|
|
||||||
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
|
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
|
||||||
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
|
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
|
|||||||
@@ -103,6 +103,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</MkSwitch>
|
</MkSwitch>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
|
||||||
|
<MkFolder v-if="matchQuery([i18n.ts._role._options.canUseTranslator, 'canSearchNotes'])">
|
||||||
|
<template #label>{{ i18n.ts._role._options.canUseTranslator }}</template>
|
||||||
|
<template #suffix>{{ policies.canUseTranslator ? i18n.ts.yes : i18n.ts.no }}</template>
|
||||||
|
<MkSwitch v-model="policies.canUseTranslator">
|
||||||
|
<template #label>{{ i18n.ts.enable }}</template>
|
||||||
|
</MkSwitch>
|
||||||
|
</MkFolder>
|
||||||
|
|
||||||
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
|
<MkFolder v-if="matchQuery([i18n.ts._role._options.driveCapacity, 'driveCapacityMb'])">
|
||||||
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
|
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
|
||||||
<template #suffix>{{ policies.driveCapacityMb }}MB</template>
|
<template #suffix>{{ policies.driveCapacityMb }}MB</template>
|
||||||
|
|||||||
@@ -15,11 +15,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<div :class="$style.tl">
|
<div :class="$style.tl">
|
||||||
<MkTimeline
|
<MkTimeline
|
||||||
ref="tlComponent"
|
ref="tlComponent"
|
||||||
:key="src + withRenotes + withReplies"
|
:key="src + withRenotes + withReplies + onlyFiles"
|
||||||
:src="src.split(':')[0]"
|
:src="src.split(':')[0]"
|
||||||
:list="src.split(':')[1]"
|
:list="src.split(':')[1]"
|
||||||
:withRenotes="withRenotes"
|
:withRenotes="withRenotes"
|
||||||
:withReplies="withReplies"
|
:withReplies="withReplies"
|
||||||
|
:onlyFiles="onlyFiles"
|
||||||
:sound="true"
|
:sound="true"
|
||||||
@queue="queueUpdated"
|
@queue="queueUpdated"
|
||||||
/>
|
/>
|
||||||
@@ -62,6 +63,7 @@ let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global');
|
|||||||
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
||||||
const withRenotes = $ref(true);
|
const withRenotes = $ref(true);
|
||||||
const withReplies = $ref(false);
|
const withReplies = $ref(false);
|
||||||
|
const onlyFiles = $ref(false);
|
||||||
|
|
||||||
watch($$(src), () => queue = 0);
|
watch($$(src), () => queue = 0);
|
||||||
|
|
||||||
@@ -147,6 +149,11 @@ const headerActions = $computed(() => [{
|
|||||||
text: i18n.ts.withReplies,
|
text: i18n.ts.withReplies,
|
||||||
icon: 'ti ti-arrow-back-up',
|
icon: 'ti ti-arrow-back-up',
|
||||||
ref: $$(withReplies),
|
ref: $$(withReplies),
|
||||||
|
}, {
|
||||||
|
type: 'switch',
|
||||||
|
text: i18n.ts.fileAttachedOnly,
|
||||||
|
icon: 'ti ti-photo',
|
||||||
|
ref: $$(onlyFiles),
|
||||||
}], ev.currentTarget ?? ev.target);
|
}], ev.currentTarget ?? ev.target);
|
||||||
},
|
},
|
||||||
}]);
|
}]);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import * as os from '@/os.js';
|
|||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
import { customEmojis } from '@/custom-emojis.js';
|
import { customEmojis } from '@/custom-emojis.js';
|
||||||
import { lang } from '@/config.js';
|
import { url, lang } from '@/config.js';
|
||||||
|
|
||||||
export function createAiScriptEnv(opts) {
|
export function createAiScriptEnv(opts) {
|
||||||
return {
|
return {
|
||||||
@@ -17,6 +17,7 @@ export function createAiScriptEnv(opts) {
|
|||||||
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),
|
LOCALE: values.STR(lang),
|
||||||
|
SERVER_URL: values.STR(url),
|
||||||
'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',
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ export function getNoteMenu(props: {
|
|||||||
text: i18n.ts.share,
|
text: i18n.ts.share,
|
||||||
action: share,
|
action: share,
|
||||||
},
|
},
|
||||||
instance.translatorAvailable ? {
|
$i && $i.policies.canUseTranslator && instance.translatorAvailable ? {
|
||||||
icon: 'ti ti-language-hiragana',
|
icon: 'ti ti-language-hiragana',
|
||||||
text: i18n.ts.translate,
|
text: i18n.ts.translate,
|
||||||
action: translate,
|
action: translate,
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export type Column = {
|
|||||||
tl?: 'home' | 'local' | 'social' | 'global';
|
tl?: 'home' | 'local' | 'social' | 'global';
|
||||||
withRenotes?: boolean;
|
withRenotes?: boolean;
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
|
onlyFiles?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deckStore = markRaw(new Storage('deck', {
|
export const deckStore = markRaw(new Storage('deck', {
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<MkTimeline
|
<MkTimeline
|
||||||
v-else-if="column.tl"
|
v-else-if="column.tl"
|
||||||
ref="timeline"
|
ref="timeline"
|
||||||
:key="column.tl + withRenotes + withReplies"
|
:key="column.tl + withRenotes + withReplies + onlyFiles"
|
||||||
:src="column.tl"
|
:src="column.tl"
|
||||||
:withRenotes="withRenotes"
|
:withRenotes="withRenotes"
|
||||||
:withReplies="withReplies"
|
:withReplies="withReplies"
|
||||||
|
:onlyFiles="onlyFiles"
|
||||||
/>
|
/>
|
||||||
</XColumn>
|
</XColumn>
|
||||||
</template>
|
</template>
|
||||||
@@ -52,6 +53,7 @@ const isLocalTimelineAvailable = (($i == null && instance.policies.ltlAvailable)
|
|||||||
const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable));
|
const isGlobalTimelineAvailable = (($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable));
|
||||||
const withRenotes = $ref(props.column.withRenotes ?? true);
|
const withRenotes = $ref(props.column.withRenotes ?? true);
|
||||||
const withReplies = $ref(props.column.withReplies ?? false);
|
const withReplies = $ref(props.column.withReplies ?? false);
|
||||||
|
const onlyFiles = $ref(props.column.onlyFiles ?? false);
|
||||||
|
|
||||||
watch($$(withRenotes), v => {
|
watch($$(withRenotes), v => {
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
@@ -65,6 +67,12 @@ watch($$(withReplies), v => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch($$(onlyFiles), v => {
|
||||||
|
updateColumn(props.column.id, {
|
||||||
|
onlyFiles: v,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.tl == null) {
|
if (props.column.tl == null) {
|
||||||
setType();
|
setType();
|
||||||
@@ -111,6 +119,10 @@ const menu = [{
|
|||||||
type: 'switch',
|
type: 'switch',
|
||||||
text: i18n.ts.withReplies,
|
text: i18n.ts.withReplies,
|
||||||
ref: $$(withReplies),
|
ref: $$(withReplies),
|
||||||
|
}, {
|
||||||
|
type: 'switch',
|
||||||
|
text: i18n.ts.fileAttachedOnly,
|
||||||
|
ref: $$(onlyFiles),
|
||||||
}];
|
}];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user