1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-27 06:18:46 +09:00
This commit is contained in:
NoriDev 2024-05-13 15:36:51 +09:00
parent 3241db64ab
commit e54dd80c30
56 changed files with 78 additions and 79 deletions

View File

@ -1,5 +1,5 @@
Unless otherwise stated this repository is Unless otherwise stated this repository is
Copyright © 2014-2024 syuilo and noridev and other misskey, cherrypick contributors Copyright © 2014-2024 syuilo & noridev and contributors
And is distributed under The GNU Affero General Public License Version 3, you should have received a copy of the license file as LICENSE. And is distributed under The GNU Affero General Public License Version 3, you should have received a copy of the license file as LICENSE.

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and misskey-project and cherrypick-contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -17,8 +17,8 @@ import { UtilityService } from '@/core/UtilityService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
import type { GlobalEvents } from '@/core/GlobalEventService.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js';
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js'; import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
import type { OnApplicationShutdown } from '@nestjs/common';
import { deserializeAntenna } from './deserializeAntenna.js'; import { deserializeAntenna } from './deserializeAntenna.js';
import type { OnApplicationShutdown } from '@nestjs/common';
@Injectable() @Injectable()
export class AntennaService implements OnApplicationShutdown { export class AntennaService implements OnApplicationShutdown {

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: cherrypick-contributors * SPDX-FileCopyrightText: noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -120,12 +120,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
const previousMonth = expirationDate.getUTCMonth(); const previousMonth = expirationDate.getUTCMonth();
(ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } : (ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } :
ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } : ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } :
ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } :
ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } :
ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } :
ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } :
ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } :
ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })();
return await this.abuseReportResolverRepository.insert({ return await this.abuseReportResolverRepository.insert({
id: this.idService.gen(), id: this.idService.gen(),

View File

@ -103,12 +103,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
const previousMonth = expirationDate.getUTCMonth(); const previousMonth = expirationDate.getUTCMonth();
(ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } : (ps.expiresAt === '1hour' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 hour')); } :
ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } : ps.expiresAt === '12hours' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('12 hours')); } :
ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } : ps.expiresAt === '1day' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 day')); } :
ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } : ps.expiresAt === '1week' ? function () { expirationDate!.setTime(expirationDate!.getTime() + ms('1 week')); } :
ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } : ps.expiresAt === '1month' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 1 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 1 + 1) / 12))); } :
ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } : ps.expiresAt === '3months' ? function () {expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 3 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 3 + 1) / 12))); } :
ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } : ps.expiresAt === '6months' ? function () { expirationDate!.setUTCMonth((expirationDate!.getUTCMonth() + 6 + 1) % 12 - 1); expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + (Math.floor((previousMonth + 6 + 1) / 12))); } :
ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })(); ps.expiresAt === '1year' ? function () { expirationDate!.setUTCFullYear(expirationDate!.getUTCFullYear() + 1); } : function () { expirationDate = null; })();
properties.expiresAt = ps.expiresAt; properties.expiresAt = ps.expiresAt;
properties.expirationDate = expirationDate; properties.expirationDate = expirationDate;

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
@ -173,4 +173,3 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}); });
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -106,7 +106,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
) { ) {
super({ super({
...meta, ...meta,
requireRolePolicy: "canEditNote", // 修正された部分 requireRolePolicy: 'canEditNote', // 修正された部分
}, paramDef, async (ps, me) => { }, paramDef, async (ps, me) => {
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);

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
@ -72,31 +72,31 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
if (!policies.canUseTranslator) { if (!policies.canUseTranslator) {
throw new ApiError(meta.errors.unavailable); throw new ApiError(meta.errors.unavailable);
} }
const target = await this.getterService.getUserProfiles(ps.userId).catch(err => { const target = await this.getterService.getUserProfiles(ps.userId).catch(err => {
if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchDescription); if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchDescription);
throw err; throw err;
}); });
if (target.description == null) { if (target.description == null) {
return; return;
} }
const instance = await this.metaService.fetch(); const instance = await this.metaService.fetch();
const translatorServices = [ const translatorServices = [
'deepl', 'deepl',
'google_no_api', 'google_no_api',
'ctav3', 'ctav3',
]; ];
if (instance.translatorType == null || !translatorServices.includes(instance.translatorType)) { if (instance.translatorType == null || !translatorServices.includes(instance.translatorType)) {
return Promise.resolve(204); // Promise.resolveで204をラップする return Promise.resolve(204); // Promise.resolveで204をラップする
} }
let targetLang = ps.targetLang; let targetLang = ps.targetLang;
if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0];
let translationResult; let translationResult;
if (instance.translatorType === 'deepl') { if (instance.translatorType === 'deepl') {
if (instance.deeplAuthKey == null) { if (instance.deeplAuthKey == null) {
@ -106,9 +106,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} else if (instance.translatorType === 'google_no_api') { } else if (instance.translatorType === 'google_no_api') {
let targetLang = ps.targetLang; let targetLang = ps.targetLang;
if (targetLang.includes('-')) targetLang = targetLang.split('-')[0]; if (targetLang.includes('-')) targetLang = targetLang.split('-')[0];
const { text, raw } = await translate(target.description, { to: targetLang }); const { text, raw } = await translate(target.description, { to: targetLang });
return { return {
sourceLang: raw.src, sourceLang: raw.src,
text: text, text: text,
@ -124,13 +124,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
} else { } else {
throw new Error('Unsupported translator type'); throw new Error('Unsupported translator type');
} }
return Promise.resolve({ return Promise.resolve({
sourceLang: translationResult.sourceLang || '', sourceLang: translationResult.sourceLang || '',
text: translationResult.text || '', text: translationResult.text || '',
translator: translationResult.translator || [], translator: translationResult.translator || [],
}); });
}); });
} }
private async translateDeepL(text: string, targetLang: string, authKey: string, isPro: boolean, provider: string) { private async translateDeepL(text: string, targetLang: string, authKey: string, isPro: boolean, provider: string) {

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
@ -113,7 +113,7 @@ class MessagingChannel extends Channel {
if (now.getTime() - date.getTime() > 5000) delete this.typers[userId]; if (now.getTime() - date.getTime() > 5000) delete this.typers[userId];
} }
const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { schema: "UserLite" }); const users = await this.userEntityService.packMany(Object.keys(this.typers), null, { schema: 'UserLite' });
this.send({ this.send({
type: 'typers', type: 'typers',

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
<!-- <!--
SPDX-FileCopyrightText: syuilo and misskey-project SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
--> -->

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: syuilo and noridev and other misskey, cherrypick contributors * SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */

View File

@ -45,7 +45,7 @@ import { globalEvents } from '@/events.js';
import { injectReactiveMetadata } from '@/scripts/page-metadata.js'; import { injectReactiveMetadata } from '@/scripts/page-metadata.js';
import { deviceKind } from '@/scripts/device-kind.js'; import { deviceKind } from '@/scripts/device-kind.js';
import { defaultStore } from '@/store.js'; import { defaultStore } from '@/store.js';
import { mainRouter } from "@/router/main.js"; import { mainRouter } from '@/router/main.js';
const MOBILE_THRESHOLD = 500; const MOBILE_THRESHOLD = 500;

View File

@ -1,5 +1,5 @@
<!-- <!--
SPDX-FileCopyrightText: syuilo and misskey-project SPDX-FileCopyrightText: syuilo and misskey-project & noridev and cherrypick-project
SPDX-License-Identifier: AGPL-3.0-only SPDX-License-Identifier: AGPL-3.0-only
--> -->