Skip to content

Commit

Permalink
Merge remote-branch 'misskey/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Dec 13, 2023
2 parents d01696f + 5472f4b commit 9df37ca
Show file tree
Hide file tree
Showing 23 changed files with 218 additions and 267 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Feat: メールアドレスの認証にverifymail.ioを使えるように (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/971ba07a44550f68d2ba31c62066db2d43a0caed)
- Feat: モデレーターがユーザーのアイコンもしくはバナー画像を未設定状態にできる機能を追加 (cherry-pick from https://github.com/TeamNijimiss/misskey/commit/e0eb5a752f6e5616d6312bb7c9790302f9dbff83)
- Feat: TL上からノートが見えなくなるワードミュートであるハードミュートを追加
- Enhance: アイコンデコレーションを複数設定できるように
- Fix: MFM `$[unixtime ]` に不正な値を入力した際に発生する各種エラーを修正

### Client
Expand Down
7 changes: 5 additions & 2 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
export interface Locale {
"_lang_": string;
"cannotBeUsedFunc": string;
"maxinumLayerError": string;
"layer": string;
"Xcoordinate": string;
"Ycoordinate": string;
"scale": string;
Expand Down Expand Up @@ -337,6 +335,7 @@ export interface Locale {
"removeAreYouSure": string;
"deleteAreYouSure": string;
"resetAreYouSure": string;
"areYouSure": string;
"saved": string;
"messaging": string;
"upload": string;
Expand Down Expand Up @@ -1265,6 +1264,7 @@ export interface Locale {
"avatarDecorations": string;
"attach": string;
"detach": string;
"detachAll": string;
"angle": string;
"flip": string;
"showAvatarDecorations": string;
Expand All @@ -1278,6 +1278,7 @@ export interface Locale {
"doReaction": string;
"code": string;
"reloadRequiredToApplySettings": string;
"remainingN": string;
"showUnreadNotificationsCount": string;
"showCatOnly": string;
"additionalPermissionsForFlash": string;
Expand Down Expand Up @@ -1919,6 +1920,7 @@ export interface Locale {
"canHideAds": string;
"canSearchNotes": string;
"canUseTranslator": string;
"avatarDecorationLimit": string;
};
"_condition": {
"isLocal": string;
Expand Down Expand Up @@ -2500,6 +2502,7 @@ export interface Locale {
"changeAvatar": string;
"changeBanner": string;
"verifiedLinkDescription": string;
"avatarDecorationMax": string;
};
"_exportOrImport": {
"allNotes": string;
Expand Down
5 changes: 5 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ removed: "削除しました"
removeAreYouSure: "「{x}」を削除しますか?"
deleteAreYouSure: "「{x}」を削除しますか?"
resetAreYouSure: "リセットしますか?"
areYouSure: "よろしいですか?"
saved: "保存しました"
messaging: "チャット"
upload: "アップロード"
Expand Down Expand Up @@ -1260,6 +1261,7 @@ tosAndPrivacyPolicy: "利用規約・プライバシーポリシー"
avatarDecorations: "アイコンデコレーション"
attach: "付ける"
detach: "外す"
detachAll: "全て外す"
angle: "角度"
flip: "反転"
showAvatarDecorations: "アイコンのデコレーションを表示"
Expand All @@ -1273,6 +1275,7 @@ cwNotationRequired: "「内容を隠す」がオンの場合は注釈の記述
doReaction: "リアクションする"
code: "コード"
reloadRequiredToApplySettings: "設定の反映にはリロードが必要です。"
remainingN: "残り: {n}"
showUnreadNotificationsCount: "未読の通知の数を表示する"
showCatOnly: "キャット付きのみ"
additionalPermissionsForFlash: "Playへの追加許可"
Expand Down Expand Up @@ -1824,6 +1827,7 @@ _role:
canHideAds: "広告の非表示"
canSearchNotes: "ノート検索の利用"
canUseTranslator: "翻訳機能の利用"
avatarDecorationLimit: "アイコンデコレーションの最大取付個数"
_condition:
isLocal: "ローカルユーザー"
isRemote: "リモートユーザー"
Expand Down Expand Up @@ -2397,6 +2401,7 @@ _profile:
changeAvatar: "アイコン画像を変更"
changeBanner: "バナー画像を変更"
verifiedLinkDescription: "内容にURLを設定すると、リンク先のWebサイトに自分のプロフィールへのリンクが含まれている場合に所有者確認済みアイコンを表示させることができます。"
avatarDecorationMax: "最大{max}つまでデコレーションを付けられます。"

_exportOrImport:
allNotes: "全てのノート"
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/core/RoleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type RolePolicies = {
userListLimit: number;
userEachUserListsLimit: number;
rateLimitFactor: number;
avatarDecorationLimit: number;
};

export const DEFAULT_POLICIES: RolePolicies = {
Expand Down Expand Up @@ -75,6 +76,7 @@ export const DEFAULT_POLICIES: RolePolicies = {
userListLimit: 10,
userEachUserListsLimit: 50,
rateLimitFactor: 1,
avatarDecorationLimit: 1,
};

@Injectable()
Expand Down Expand Up @@ -329,6 +331,7 @@ export class RoleService implements OnApplicationShutdown {
userListLimit: calc('userListLimit', vs => Math.max(...vs)),
userEachUserListsLimit: calc('userEachUserListsLimit', vs => Math.max(...vs)),
rateLimitFactor: calc('rateLimitFactor', vs => Math.max(...vs)),
avatarDecorationLimit: calc('avatarDecorationLimit', vs => Math.max(...vs)),
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/models/json-schema/role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const packedRoleSchema = {
userEachUserListsLimit: rolePolicyValue,
canManageAvatarDecorations: rolePolicyValue,
canUseTranslator: rolePolicyValue,
avatarDecorationLimit: rolePolicyValue,
},
},
usersCount: {
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/models/json-schema/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ export const packedMeDetailedOnlySchema = {
type: 'number',
nullable: false, optional: false,
},
avatarDecorationLimit: {
type: 'number',
nullable: false, optional: false,
},
},
},
//#region secrets
Expand Down
6 changes: 4 additions & 2 deletions packages/backend/src/server/api/endpoints/i/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const paramDef = {
birthday: { ...birthdaySchema, nullable: true },
lang: { type: 'string', enum: [null, ...Object.keys(langmap)] as string[], nullable: true },
avatarId: { type: 'string', format: 'misskey:id', nullable: true },
avatarDecorations: { type: 'array', maxItems: 1, items: {
avatarDecorations: { type: 'array', maxItems: 16, items: {
type: 'object',
properties: {
id: { type: 'string', format: 'misskey:id' },
Expand Down Expand Up @@ -333,12 +333,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

if (ps.avatarDecorations) {
const decorations = await this.avatarDecorationService.getAll(true);
const myRoles = await this.roleService.getUserRoles(user.id);
const [myRoles, myPolicies] = await Promise.all([this.roleService.getUserRoles(user.id), this.roleService.getUserPolicies(user.id)]);
const allRoles = await this.roleService.getRoles();
const decorationIds = decorations
.filter(d => d.roleIdsThatCanBeUsedThisDecoration.filter(roleId => allRoles.some(r => r.id === roleId)).length === 0 || myRoles.some(r => d.roleIdsThatCanBeUsedThisDecoration.includes(r.id)))
.map(d => d.id);

if (ps.avatarDecorations.length > myPolicies.avatarDecorationLimit) throw new ApiError(meta.errors.restrictedByRole);

updates.avatarDecorations = ps.avatarDecorations.filter(d => decorationIds.includes(d.id)).map(d => ({
id: d.id,
angle: d.angle ?? 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/autogen/apiClientJSDoc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* version: 4.6.0-beta.2
* basedMisskeyVersion: 2023.12.0-beta.3
* generatedAt: 2023-12-13T07:55:59.676Z
* generatedAt: 2023-12-13T08:44:16.948Z
*/

import type { SwitchCaseResponseType } from '../api.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/autogen/endpoint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* version: 4.6.0-beta.2
* basedMisskeyVersion: 2023.12.0-beta.3
* generatedAt: 2023-12-13T07:55:59.674Z
* generatedAt: 2023-12-13T08:44:16.944Z
*/

import type {
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/autogen/entities.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* version: 4.6.0-beta.2
* basedMisskeyVersion: 2023.12.0-beta.3
* generatedAt: 2023-12-13T07:55:59.673Z
* generatedAt: 2023-12-13T08:44:16.943Z
*/

import { operations } from './types.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/cherrypick-js/src/autogen/models.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* version: 4.6.0-beta.2
* basedMisskeyVersion: 2023.12.0-beta.3
* generatedAt: 2023-12-13T07:55:59.672Z
* generatedAt: 2023-12-13T08:44:16.941Z
*/

import { components } from './types.js';
Expand Down
8 changes: 7 additions & 1 deletion packages/cherrypick-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*
* version: 4.6.0-beta.2
* basedMisskeyVersion: 2023.12.0-beta.3
* generatedAt: 2023-12-13T07:55:59.592Z
* generatedAt: 2023-12-13T08:44:16.816Z
*/

/**
Expand Down Expand Up @@ -3960,6 +3960,7 @@ export type components = {
userListLimit: number;
userEachUserListsLimit: number;
rateLimitFactor: number;
avatarDecorationLimit: number;
};
email?: string | null;
emailVerified?: boolean | null;
Expand Down Expand Up @@ -4675,6 +4676,11 @@ export type components = {
priority: number;
useDefault: boolean;
};
avatarDecorationLimit: {
value: number | boolean;
priority: number;
useDefault: boolean;
};
};
usersCount: number;
});
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ export async function openAccountMenu(opts: {
text: i18n.ts.profile,
to: `/@${ $i.username }`,
avatar: $i,
}, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
}, { type: 'divider' }, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, {
type: 'parent' as const,
icon: 'ti ti-plus',
text: i18n.ts.addAccount,
Expand Down
9 changes: 5 additions & 4 deletions packages/frontend/src/components/MkDrive.folder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { i18n } from '@/i18n.js';
import { defaultStore } from '@/store.js';
import { claimAchievement } from '@/scripts/achievements.js';
import copyToClipboard from '@/scripts/copy-to-clipboard.js';
import { MenuItem } from '@/types/menu.js';

const props = withDefaults(defineProps<{
folder: Misskey.entities.DriveFolder;
Expand Down Expand Up @@ -250,7 +251,7 @@ function setAsUploadFolder() {
}

function onContextmenu(ev: MouseEvent) {
let menu;
let menu: MenuItem[];
menu = [{
text: i18n.ts.openInWindow,
icon: 'ti ti-app-window',
Expand All @@ -260,18 +261,18 @@ function onContextmenu(ev: MouseEvent) {
}, {
}, 'closed');
},
}, null, {
}, { type: 'divider' }, {
text: i18n.ts.rename,
icon: 'ti ti-forms',
action: rename,
}, null, {
}, { type: 'divider' }, {
text: i18n.ts.delete,
icon: 'ti ti-trash',
danger: true,
action: deleteFolder,
}];
if (defaultStore.state.devMode) {
menu = menu.concat([null, {
menu = menu.concat([{ type: 'divider' }, {
icon: 'ti ti-id',
text: i18n.ts.copyFolderId,
action: () => {
Expand Down
Loading

0 comments on commit 9df37ca

Please sign in to comment.