From 46295f0b8add8cb0e959f31c0a0500326e69dac6 Mon Sep 17 00:00:00 2001 From: taiy <53635909+taiyme@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:50:56 +0900 Subject: [PATCH] =?UTF-8?q?delete!(tms):=20=E3=83=91=E3=82=AF=E3=82=8B?= =?UTF-8?q?=E3=83=BB=E6=95=B0=E5=AD=97=E5=BC=95=E7=94=A8=E3=82=92=E5=BB=83?= =?UTF-8?q?=E6=AD=A2=20(#270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 44 ---- locales/ja-JP.yml | 12 -- .../endpoints/drive/files/upload-from-url.ts | 68 +------ packages/frontend/src/components/MkDrive.vue | 2 +- packages/frontend/src/components/MkNote.vue | 5 +- .../src/components/MkNoteDetailed.vue | 6 +- .../src/pages/tms/settings/index.main.vue | 38 +--- .../frontend/src/scripts/get-note-menu.ts | 37 +--- packages/frontend/src/scripts/select-file.ts | 2 +- .../frontend/src/scripts/tms/numberquote.ts | 62 ------ packages/frontend/src/scripts/tms/pakuru.ts | 13 -- .../frontend/src/scripts/tms/to-parameters.ts | 188 ------------------ packages/frontend/src/tms/store.ts | 8 - packages/misskey-js/etc/misskey-js.api.md | 4 - packages/misskey-js/src/autogen/endpoint.ts | 3 +- packages/misskey-js/src/autogen/entities.ts | 1 - packages/misskey-js/src/autogen/types.ts | 8 +- 17 files changed, 25 insertions(+), 476 deletions(-) delete mode 100644 packages/frontend/src/scripts/tms/numberquote.ts delete mode 100644 packages/frontend/src/scripts/tms/pakuru.ts delete mode 100644 packages/frontend/src/scripts/tms/to-parameters.ts diff --git a/locales/index.d.ts b/locales/index.d.ts index f021fce95b3f..3d103f6a6cd0 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -10273,22 +10273,6 @@ export interface Locale extends ILocale { * フォロワーリノート (連合なし) */ readonly "disableFederationFollowersRenote": string; - /** - * パクる - */ - readonly "pakuru": string; - /** - * 数字引用する - */ - readonly "numberquote": string; - /** - * パクりました - */ - readonly "didPakuru": string; - /** - * 数字引用しました - */ - readonly "didNumberquote": string; /** * {user}によって解決済み */ @@ -10428,34 +10412,6 @@ export interface Locale extends ILocale { */ readonly "caption": string; }; - readonly "_pakuru": { - /** - * 「パクる」機能を有効にする - */ - readonly "label": string; - /** - * リノートメニューに「パクる」を追加します。添付ファイルを含むノートをパクる場合、時間がかかる場合があります。 - */ - readonly "caption": string; - /** - * 「パクる」は身内ノリに特化した機能です。悪用や嫌がらせなどを目的として使用しないようにしましょう。 - */ - readonly "warning": string; - }; - readonly "_numberquote": { - /** - * 「数字引用」機能を有効にする - */ - readonly "label": string; - /** - * リノートメニューに「数字引用する」を追加します。添付ファイルを含むノートを数字引用する場合、時間がかかる場合があります。 - */ - readonly "caption": string; - /** - * 「数字引用」は身内ノリに特化した機能です。悪用や嫌がらせなどを目的として使用しないようにしましょう。 - */ - readonly "warning": string; - }; }; readonly "_flags": { /** diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1d0082d00fec..d78a9bb406ed 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2739,10 +2739,6 @@ _tms: disableFederationRenote: "リノート (連合なし)" disableFederationHomeRenote: "ホームリノート (連合なし)" disableFederationFollowersRenote: "フォロワーリノート (連合なし)" - pakuru: "パクる" - numberquote: "数字引用する" - didPakuru: "パクりました" - didNumberquote: "数字引用しました" resolvedBy: "{user}によって解決済み" forwardedReport: "リモートサーバーに転送済み" notYetProvided: "まだ提供されていません" @@ -2781,14 +2777,6 @@ _tms: _pullToRefreshAllReload: label: "「引っ張ってリロード」でページ全体を再読み込みする" caption: "構成しているページ全体を再読み込みする動作に置き換えます。" - _pakuru: - label: "「パクる」機能を有効にする" - caption: "リノートメニューに「パクる」を追加します。添付ファイルを含むノートをパクる場合、時間がかかる場合があります。" - warning: "「パクる」は身内ノリに特化した機能です。悪用や嫌がらせなどを目的として使用しないようにしましょう。" - _numberquote: - label: "「数字引用」機能を有効にする" - caption: "リノートメニューに「数字引用する」を追加します。添付ファイルを含むノートを数字引用する場合、時間がかかる場合があります。" - warning: "「数字引用」は身内ノリに特化した機能です。悪用や嫌がらせなどを目的として使用しないようにしましょう。" _flags: title: "taiyme実験的機能" description: "これらの機能はtaiymeで独自実装したものです。" diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index 9b68f0f3614a..b964ae95b89c 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -5,50 +5,26 @@ import ms from 'ms'; import { Injectable } from '@nestjs/common'; -import { IdentifiableError } from '@/misc/identifiable-error.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { GlobalEventService } from '@/core/GlobalEventService.js'; import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.js'; -import { MetaService } from '@/core/MetaService.js'; import { DriveService } from '@/core/DriveService.js'; -import { ApiError } from '../../../error.js'; -import { DB_MAX_IMAGE_COMMENT_LENGTH } from '@/const.js'; export const meta = { tags: ['drive'], - requireCredential: true, - - prohibitMoved: true, - limit: { duration: ms('1hour'), max: 60, }, - kind: 'write:drive', - description: 'Request the server to download a new drive file from the specified URL.', - res: { - type: 'object', - optional: false, nullable: false, - ref: 'DriveFile', - }, + requireCredential: true, - errors: { - inappropriate: { - message: 'Cannot upload the file because it has been determined that it possibly contains inappropriate content.', - code: 'INAPPROPRIATE', - id: '8eb55988-6b8b-4e0f-8d38-97e8b5e112a0', - }, + prohibitMoved: true, - noFreeSpace: { - message: 'Cannot upload the file because you have no free space of drive.', - code: 'NO_FREE_SPACE', - id: '70e6b8ac-d2e6-4646-a5e5-a5a54525c133', - }, - }, + kind: 'write:drive', } as const; export const paramDef = { @@ -57,7 +33,7 @@ export const paramDef = { url: { type: 'string' }, folderId: { type: 'string', format: 'misskey:id', nullable: true, default: null }, isSensitive: { type: 'boolean', default: false }, - comment: { type: 'string', nullable: true, maxLength: DB_MAX_IMAGE_COMMENT_LENGTH, default: null }, + comment: { type: 'string', nullable: true, maxLength: 512, default: null }, marker: { type: 'string', nullable: true, default: null }, force: { type: 'boolean', default: false }, }, @@ -68,40 +44,18 @@ export const paramDef = { export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( private driveFileEntityService: DriveFileEntityService, - private metaService: MetaService, private driveService: DriveService, private globalEventService: GlobalEventService, ) { super(meta, paramDef, async (ps, user, _1, _2, _3, ip, headers) => { - const instance = await this.metaService.fetch(); - - try { - const driveFile = await this.driveService.uploadFromUrl({ - url: ps.url, - user, - folderId: ps.folderId, - sensitive: ps.isSensitive, - force: ps.force, - comment: ps.comment, - requestIp: instance.enableIpLogging ? ip : null, - requestHeaders: instance.enableIpLogging ? headers : null, - }); - const packedFile = await this.driveFileEntityService.pack(driveFile, { self: true }); - this.globalEventService.publishMainStream(user.id, 'urlUploadFinished', { - marker: ps.marker, - file: packedFile, + this.driveService.uploadFromUrl({ url: ps.url, user, folderId: ps.folderId, sensitive: ps.isSensitive, force: ps.force, comment: ps.comment, requestIp: ip, requestHeaders: headers }).then(file => { + this.driveFileEntityService.pack(file, { self: true }).then(packedFile => { + this.globalEventService.publishMainStream(user.id, 'urlUploadFinished', { + marker: ps.marker, + file: packedFile, + }); }); - return packedFile; - } catch (err) { - if (err instanceof Error || typeof err === 'string') { - console.error(err); - } - if (err instanceof IdentifiableError) { - if (err.id === '282f77bf-5816-4f72-9264-aa14d8261a21') throw new ApiError(meta.errors.inappropriate); - if (err.id === 'c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6') throw new ApiError(meta.errors.noFreeSpace); - } - throw new ApiError(); - } + }); }); } } diff --git a/packages/frontend/src/components/MkDrive.vue b/packages/frontend/src/components/MkDrive.vue index 9dee5bbcf010..488ed5546836 100644 --- a/packages/frontend/src/components/MkDrive.vue +++ b/packages/frontend/src/components/MkDrive.vue @@ -313,7 +313,7 @@ function urlUpload() { misskeyApi('drive/files/upload-from-url', { url: url, folderId: folder.value ? folder.value.id : undefined, - }).catch(() => {}); + }); os.alert({ title: i18n.ts.uploadFromUrlRequested, diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 917de150693d..27dfeb9786d5 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -106,7 +106,7 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ number(appearNote.repliesCount) }}