From dc8ab01168873c4eafe79eb8002a0028b58758c0 Mon Sep 17 00:00:00 2001 From: taichan <40626578+taichanNE30@users.noreply.github.com> Date: Sun, 24 Sep 2023 20:08:00 +0900 Subject: [PATCH 1/9] =?UTF-8?q?fix(backend):=20=E3=81=8A=E7=9F=A5=E3=82=89?= =?UTF-8?q?=E3=81=9B=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=8D=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=8C=E6=A9=9F=E8=83=BD=E3=81=97?= =?UTF-8?q?=E3=81=AA=E3=81=84=20#11800=20(#11890)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(backend): お知らせのページネーションが機能しない #11800 * Update CHANGELOG --- CHANGELOG.md | 10 ++++++++++ .../backend/src/server/api/endpoints/announcements.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b696116b7..5396962c07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,16 @@ --> +## (unreleased) +### General +- + +### Client +- + +### Server +- Fix: お知らせのページネーションが機能しない + ## 2023.9.0 (unreleased) ### Note diff --git a/packages/backend/src/server/api/endpoints/announcements.ts b/packages/backend/src/server/api/endpoints/announcements.ts index 498afe3448..7c242dbcd5 100644 --- a/packages/backend/src/server/api/endpoints/announcements.ts +++ b/packages/backend/src/server/api/endpoints/announcements.ts @@ -52,7 +52,7 @@ export default class extends Endpoint { // eslint- ) { super(meta, paramDef, async (ps, me) => { const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId) - .where('announcement.isActive = :isActive', { isActive: ps.isActive }) + .andWhere('announcement.isActive = :isActive', { isActive: ps.isActive }) .andWhere(new Brackets(qb => { if (me) qb.orWhere('announcement.userId = :meId', { meId: me.id }); qb.orWhere('announcement.userId IS NULL'); From 646a8d1a54106cf0ec691a5ea08da9d2009762c0 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sun, 24 Sep 2023 21:54:09 +0900 Subject: [PATCH 2/9] Add address bind config option (outgoingAddress) is feature of 2023.9 (#11894) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5396962c07..37d5029575 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ - Enhance: 自分へのメンション一覧を取得する際のパフォーマンスを向上 - Enhance: Docker環境でjemallocを使用することでメモリ使用量を削減 - Enhance: ID生成方式としてaidxを追加、かつデフォルトに +- Enhance: Add address bind config option (outgoingAddress) - Fix: MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正 - Fix: notes/reactionsのページネーションが機能しない問題を修正 - Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように @@ -130,7 +131,6 @@ ### Server - Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正 - Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正 -- Enhance: Add address bind config option (outgoingAddress) ## 13.14.1 From 5318532a8d1208b4f286856e98ff199bfdeacb9c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 25 Sep 2023 10:29:12 +0900 Subject: [PATCH 3/9] enhance: improve moderation log --- CHANGELOG.md | 4 +- locales/index.d.ts | 5 +- locales/ja-JP.yml | 5 +- .../backend/src/core/AnnouncementService.ts | 12 ++++- .../backend/src/core/CustomEmojiService.ts | 7 +-- packages/backend/src/core/DriveService.ts | 8 ++++ .../backend/src/core/NoteDeleteService.ts | 3 ++ packages/backend/src/core/RoleService.ts | 46 +++++++++++++++++- .../api/endpoints/admin/reset-password.ts | 4 +- .../api/endpoints/admin/roles/create.ts | 35 ++------------ .../api/endpoints/admin/roles/update.ts | 2 - .../api/endpoints/admin/suspend-user.ts | 4 +- .../api/endpoints/admin/unsuspend-user.ts | 4 +- .../api/endpoints/admin/update-user-note.ts | 2 + packages/backend/src/types.ts | 36 ++++++++++++-- .../src/pages/admin/modlog.ModLog.vue | 48 ++++++++++++++++--- packages/misskey-js/etc/misskey-js.api.md | 5 +- packages/misskey-js/src/consts.ts | 36 ++++++++++++-- packages/misskey-js/src/entities.ts | 3 ++ 19 files changed, 209 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37d5029575..ae5d90fff1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ ## (unreleased) ### General -- +- Enhance: モデレーションログ機能の強化 ### Client - @@ -22,7 +22,7 @@ ### Server - Fix: お知らせのページネーションが機能しない -## 2023.9.0 (unreleased) +## 2023.9.0 ### Note - meilisearchを使用する場合、v1.2以上が必要です diff --git a/locales/index.d.ts b/locales/index.d.ts index aa63c03856..5e24ecffa5 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1123,6 +1123,7 @@ export interface Locale { "unnotifyNotes": string; "authentication": string; "authenticationRequiredToContinue": string; + "dateAndTime": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; @@ -2250,9 +2251,11 @@ export interface Locale { }; }; "_moderationLogTypes": { + "createRole": string; + "deleteRole": string; + "updateRole": string; "assignRole": string; "unassignRole": string; - "updateRole": string; "suspend": string; "unsuspend": string; "addCustomEmoji": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 69c48a5e64..1af73c6201 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1120,6 +1120,7 @@ notifyNotes: "投稿を通知" unnotifyNotes: "投稿の通知を解除" authentication: "認証" authenticationRequiredToContinue: "続けるには認証を行ってください" +dateAndTime: "日時" _announcement: forExistingUsers: "既存ユーザーのみ" @@ -2163,9 +2164,11 @@ _webhookSettings: mention: "メンションされたとき" _moderationLogTypes: + createRole: "ロールを作成" + deleteRole: "ロールを削除" + updateRole: "ロールを更新" assignRole: "ロールへアサイン" unassignRole: "ロールのアサイン解除" - updateRole: "ロール設定更新" suspend: "凍結" unsuspend: "凍結解除" addCustomEmoji: "カスタム絵文字追加" diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index 2b4877788a..ddacc0936f 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -7,7 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { Brackets } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { MiUser } from '@/models/User.js'; -import type { AnnouncementReadsRepository, AnnouncementsRepository, MiAnnouncement, MiAnnouncementRead } from '@/models/_.js'; +import type { AnnouncementReadsRepository, AnnouncementsRepository, MiAnnouncement, MiAnnouncementRead, UsersRepository } from '@/models/_.js'; import { bindThis } from '@/decorators.js'; import { Packed } from '@/misc/json-schema.js'; import { IdService } from '@/core/IdService.js'; @@ -23,6 +23,9 @@ export class AnnouncementService { @Inject(DI.announcementReadsRepository) private announcementReadsRepository: AnnouncementReadsRepository, + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + private idService: IdService, private globalEventService: GlobalEventService, private moderationLogService: ModerationLogService, @@ -83,10 +86,13 @@ export class AnnouncementService { }); if (moderator) { + const user = await this.usersRepository.findOneByOrFail({ id: values.userId }); this.moderationLogService.log(moderator, 'createUserAnnouncement', { announcementId: announcement.id, announcement: announcement, userId: values.userId, + userUsername: user.username, + userHost: user.host, }); } } else { @@ -127,10 +133,14 @@ export class AnnouncementService { if (moderator) { if (announcement.userId) { + const user = await this.usersRepository.findOneByOrFail({ id: announcement.userId }); this.moderationLogService.log(moderator, 'updateUserAnnouncement', { announcementId: announcement.id, before: announcement, after: after, + userId: announcement.userId, + userUsername: user.username, + userHost: user.host, }); } else { this.moderationLogService.log(moderator, 'updateGlobalAnnouncement', { diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index b14a8666e6..1b545a124e 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -134,11 +134,11 @@ export class CustomEmojiService implements OnApplicationShutdown { this.localEmojisCache.refresh(); - const updated = await this.emojiEntityService.packDetailed(emoji.id); + const packed = await this.emojiEntityService.packDetailed(emoji.id); if (emoji.name === data.name) { this.globalEventService.publishBroadcastStream('emojiUpdated', { - emojis: [updated], + emojis: [packed], }); } else { this.globalEventService.publishBroadcastStream('emojiDeleted', { @@ -146,11 +146,12 @@ export class CustomEmojiService implements OnApplicationShutdown { }); this.globalEventService.publishBroadcastStream('emojiAdded', { - emoji: updated, + emoji: packed, }); } if (moderator) { + const updated = await this.emojisRepository.findOneByOrFail({ id: id }); this.moderationLogService.log(moderator, 'updateCustomEmoji', { emojiId: emoji.id, before: emoji, diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index 366205f586..cecbec9638 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -686,15 +686,20 @@ export class DriveService { if (await this.roleService.isModerator(updater) && (file.userId !== updater.id)) { if (values.isSensitive !== undefined && values.isSensitive !== file.isSensitive) { + const user = file.userId ? await this.usersRepository.findOneByOrFail({ id: file.userId }) : null; if (values.isSensitive) { this.moderationLogService.log(updater, 'markSensitiveDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } else { this.moderationLogService.log(updater, 'unmarkSensitiveDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } } @@ -795,9 +800,12 @@ export class DriveService { } if (deleter && await this.roleService.isModerator(deleter) && (file.userId !== deleter.id)) { + const user = file.userId ? await this.usersRepository.findOneByOrFail({ id: file.userId }) : null; this.moderationLogService.log(deleter, 'deleteDriveFile', { fileId: file.id, fileUserId: file.userId, + fileUserUsername: user?.username ?? null, + fileUserHost: user?.host ?? null, }); } } diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts index c99f92b9cb..87979f22ac 100644 --- a/packages/backend/src/core/NoteDeleteService.ts +++ b/packages/backend/src/core/NoteDeleteService.ts @@ -135,9 +135,12 @@ export class NoteDeleteService { }); if (deleter && (note.userId !== deleter.id)) { + const user = await this.usersRepository.findOneByOrFail({ id: note.userId }); this.moderationLogService.log(deleter, 'deleteNote', { noteId: note.id, noteUserId: note.userId, + noteUserUsername: user.username, + noteUserHost: user.host, note: note, }); } diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index dea6dc68cd..934b7d676b 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -412,10 +412,13 @@ export class RoleService implements OnApplicationShutdown { this.globalEventService.publishInternalEvent('userRoleAssigned', created); if (moderator) { + const user = await this.usersRepository.findOneByOrFail({ id: userId }); this.moderationLogService.log(moderator, 'assignRole', { roleId: roleId, roleName: role.name, userId: userId, + userUsername: user.username, + userHost: user.host, expiresAt: expiresAt ? expiresAt.toISOString() : null, }); } @@ -445,11 +448,16 @@ export class RoleService implements OnApplicationShutdown { this.globalEventService.publishInternalEvent('userRoleUnassigned', existing); if (moderator) { - const role = await this.rolesRepository.findOneByOrFail({ id: roleId }); + const [user, role] = await Promise.all([ + this.usersRepository.findOneByOrFail({ id: userId }), + this.rolesRepository.findOneByOrFail({ id: roleId }), + ]); this.moderationLogService.log(moderator, 'unassignRole', { roleId: roleId, roleName: role.name, userId: userId, + userUsername: user.username, + userHost: user.host, }); } } @@ -473,6 +481,42 @@ export class RoleService implements OnApplicationShutdown { redisPipeline.exec(); } + @bindThis + public async create(values: Partial, moderator?: MiUser): Promise { + const date = new Date(); + const created = await this.rolesRepository.insert({ + id: this.idService.genId(), + createdAt: date, + updatedAt: date, + lastUsedAt: date, + name: values.name, + description: values.description, + color: values.color, + iconUrl: values.iconUrl, + target: values.target, + condFormula: values.condFormula, + isPublic: values.isPublic, + isAdministrator: values.isAdministrator, + isModerator: values.isModerator, + isExplorable: values.isExplorable, + asBadge: values.asBadge, + canEditMembersByModerator: values.canEditMembersByModerator, + displayOrder: values.displayOrder, + policies: values.policies, + }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); + + this.globalEventService.publishInternalEvent('roleCreated', created); + + if (moderator) { + this.moderationLogService.log(moderator, 'createRole', { + roleId: created.id, + role: created, + }); + } + + return created; + } + @bindThis public async update(role: MiRole, params: Partial, moderator?: MiUser): Promise { const date = new Date(); diff --git a/packages/backend/src/server/api/endpoints/admin/reset-password.ts b/packages/backend/src/server/api/endpoints/admin/reset-password.ts index 6ce7583276..13e9c30ed8 100644 --- a/packages/backend/src/server/api/endpoints/admin/reset-password.ts +++ b/packages/backend/src/server/api/endpoints/admin/reset-password.ts @@ -73,7 +73,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'resetPassword', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); return { diff --git a/packages/backend/src/server/api/endpoints/admin/roles/create.ts b/packages/backend/src/server/api/endpoints/admin/roles/create.ts index f567b0d387..8451b1955f 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/create.ts @@ -5,11 +5,8 @@ import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; -import type { RolesRepository } from '@/models/_.js'; -import { GlobalEventService } from '@/core/GlobalEventService.js'; -import { DI } from '@/di-symbols.js'; -import { IdService } from '@/core/IdService.js'; import { RoleEntityService } from '@/core/entities/RoleEntityService.js'; +import { RoleService } from '@/core/RoleService.js'; export const meta = { tags: ['admin', 'role'], @@ -58,37 +55,11 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( - @Inject(DI.rolesRepository) - private rolesRepository: RolesRepository, - - private globalEventService: GlobalEventService, - private idService: IdService, private roleEntityService: RoleEntityService, + private roleService: RoleService, ) { super(meta, paramDef, async (ps, me) => { - const date = new Date(); - const created = await this.rolesRepository.insert({ - id: this.idService.genId(), - createdAt: date, - updatedAt: date, - lastUsedAt: date, - name: ps.name, - description: ps.description, - color: ps.color, - iconUrl: ps.iconUrl, - target: ps.target, - condFormula: ps.condFormula, - isPublic: ps.isPublic, - isAdministrator: ps.isAdministrator, - isModerator: ps.isModerator, - isExplorable: ps.isExplorable, - asBadge: ps.asBadge, - canEditMembersByModerator: ps.canEditMembersByModerator, - displayOrder: ps.displayOrder, - policies: ps.policies, - }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); - - this.globalEventService.publishInternalEvent('roleCreated', created); + const created = await this.roleService.create(ps, me); return await this.roleEntityService.pack(created, me); }); diff --git a/packages/backend/src/server/api/endpoints/admin/roles/update.ts b/packages/backend/src/server/api/endpoints/admin/roles/update.ts index e4e59e487c..6031e2363e 100644 --- a/packages/backend/src/server/api/endpoints/admin/roles/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/roles/update.ts @@ -79,9 +79,7 @@ export default class extends Endpoint { // eslint- throw new ApiError(meta.errors.noSuchRole); } - const date = new Date(); await this.roleService.update(role, { - updatedAt: date, name: ps.name, description: ps.description, color: ps.color, diff --git a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts index 89199f8bff..9464f4b677 100644 --- a/packages/backend/src/server/api/endpoints/admin/suspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/suspend-user.ts @@ -61,7 +61,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'suspend', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); (async () => { diff --git a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts index a2779148ed..5e523bbc31 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsuspend-user.ts @@ -46,7 +46,9 @@ export default class extends Endpoint { // eslint- }); this.moderationLogService.log(me, 'unsuspend', { - targetId: user.id, + userId: user.id, + userUsername: user.username, + userHost: user.host, }); this.userSuspendService.doPostUnsuspend(user); diff --git a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts index 2e9fd5ad29..bfccc2a2a5 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-user-note.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-user-note.ts @@ -51,6 +51,8 @@ export default class extends Endpoint { // eslint- this.moderationLogService.log(me, 'updateUserNote', { userId: user.id, + userUsername: user.username, + userHost: user.host, before: currentProfile.moderationNote, after: ps.text, }); diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 16654edd88..b458c0fbcb 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -37,6 +37,7 @@ export const moderationLogTypes = [ 'deleteCustomEmoji', 'assignRole', 'unassignRole', + 'createRole', 'updateRole', 'deleteRole', 'clearQueue', @@ -62,13 +63,19 @@ export type ModerationLogPayloads = { after: any | null; }; suspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; unsuspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; updateUserNote: { userId: string; + userUsername: string; + userHost: string | null; before: string | null; after: string | null; }; @@ -87,15 +94,23 @@ export type ModerationLogPayloads = { }; assignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; expiresAt: string | null; }; unassignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; }; + createRole: { + roleId: string; + role: any; + }; updateRole: { roleId: string; before: any; @@ -110,10 +125,14 @@ export type ModerationLogPayloads = { deleteDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; deleteNote: { noteId: string; noteUserId: string; + noteUserUsername: string; + noteUserHost: string | null; note: any; }; createGlobalAnnouncement: { @@ -124,6 +143,8 @@ export type ModerationLogPayloads = { announcementId: string; announcement: any; userId: string; + userUsername: string; + userHost: string | null; }; updateGlobalAnnouncement: { announcementId: string; @@ -134,6 +155,9 @@ export type ModerationLogPayloads = { announcementId: string; before: any; after: any; + userId: string; + userUsername: string; + userHost: string | null; }; deleteGlobalAnnouncement: { announcementId: string; @@ -144,7 +168,9 @@ export type ModerationLogPayloads = { announcement: any; }; resetPassword: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; suspendRemoteInstance: { id: string; @@ -157,9 +183,13 @@ export type ModerationLogPayloads = { markSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; unmarkSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; }; diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue index ce7b89f8f7..f0de026ad8 100644 --- a/packages/frontend/src/pages/admin/modlog.ModLog.vue +++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue @@ -5,33 +5,61 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index b3806754a8..f72532f297 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -2550,6 +2550,9 @@ type ModerationLog = { } | { type: 'unassignRole'; info: ModerationLogPayloads['unassignRole']; +} | { + type: 'createRole'; + info: ModerationLogPayloads['createRole']; } | { type: 'updateRole'; info: ModerationLogPayloads['updateRole']; @@ -2604,7 +2607,7 @@ type ModerationLog = { }); // @public (undocumented) -export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile"]; +export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile"]; // @public (undocumented) export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index 63137dcc83..d2751c447e 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -55,6 +55,7 @@ export const moderationLogTypes = [ 'deleteCustomEmoji', 'assignRole', 'unassignRole', + 'createRole', 'updateRole', 'deleteRole', 'clearQueue', @@ -80,13 +81,19 @@ export type ModerationLogPayloads = { after: any | null; }; suspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; unsuspend: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; updateUserNote: { userId: string; + userUsername: string; + userHost: string | null; before: string | null; after: string | null; }; @@ -105,15 +112,23 @@ export type ModerationLogPayloads = { }; assignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; expiresAt: string | null; }; unassignRole: { userId: string; + userUsername: string; + userHost: string | null; roleId: string; roleName: string; }; + createRole: { + roleId: string; + role: any; + }; updateRole: { roleId: string; before: any; @@ -128,10 +143,14 @@ export type ModerationLogPayloads = { deleteDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; deleteNote: { noteId: string; noteUserId: string; + noteUserUsername: string; + noteUserHost: string | null; note: any; }; createGlobalAnnouncement: { @@ -142,6 +161,8 @@ export type ModerationLogPayloads = { announcementId: string; announcement: any; userId: string; + userUsername: string; + userHost: string | null; }; updateGlobalAnnouncement: { announcementId: string; @@ -152,6 +173,9 @@ export type ModerationLogPayloads = { announcementId: string; before: any; after: any; + userId: string; + userUsername: string; + userHost: string | null; }; deleteGlobalAnnouncement: { announcementId: string; @@ -162,7 +186,9 @@ export type ModerationLogPayloads = { announcement: any; }; resetPassword: { - targetId: string; + userId: string; + userUsername: string; + userHost: string | null; }; suspendRemoteInstance: { id: string; @@ -175,9 +201,13 @@ export type ModerationLogPayloads = { markSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; unmarkSensitiveDriveFile: { fileId: string; fileUserId: string | null; + fileUserUsername: string | null; + fileUserHost: string | null; }; }; diff --git a/packages/misskey-js/src/entities.ts b/packages/misskey-js/src/entities.ts index f377f1a5ed..41c9bdef6e 100644 --- a/packages/misskey-js/src/entities.ts +++ b/packages/misskey-js/src/entities.ts @@ -601,6 +601,9 @@ export type ModerationLog = { } | { type: 'unassignRole'; info: ModerationLogPayloads['unassignRole']; +} | { + type: 'createRole'; + info: ModerationLogPayloads['createRole']; } | { type: 'updateRole'; info: ModerationLogPayloads['updateRole']; From dcaea66dbfc642d9e3753561364081a38c4b659c Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:30:00 +0900 Subject: [PATCH 4/9] =?UTF-8?q?fix(frontend):=20=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E7=8A=B6=E6=85=8B=E3=81=A7=E3=81=AE?= =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC?= =?UTF-8?q?=E5=86=85=E3=81=AE=E8=A9=B3=E7=B4=B0=E3=83=9C=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E3=82=92=E3=83=AD=E3=82=B0=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E7=8A=B6=E6=85=8B=E3=81=A8=E5=90=8C=E3=81=98=E3=81=AB?= =?UTF-8?q?=20(#11896)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): ログアウト状態でのノートの詳細ボタンの表示をログイン状態と同じに * Update CHANGELOG.md --- CHANGELOG.md | 2 +- packages/frontend/src/scripts/get-note-menu.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae5d90fff1..2703ef2aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ - Enhance: モデレーションログ機能の強化 ### Client -- +- Fix: ノートのメニューにある「詳細」ボタンの表示がログイン/ログアウト状態で統一されていない問題を修正 ### Server - Fix: お知らせのページネーションが機能しない diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 734a632039..0948741fc5 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -368,8 +368,8 @@ export function getNoteMenu(props: { .filter(x => x !== undefined); } else { menu = [{ - icon: 'ti ti-external-link', - text: i18n.ts.detailed, + icon: 'ti ti-info-circle', + text: i18n.ts.details, action: openDetail, }, { icon: 'ti ti-copy', From 576158e883aaed29c9aefa904c516c7ae7db02c3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 25 Sep 2023 10:34:07 +0900 Subject: [PATCH 5/9] =?UTF-8?q?fix(backend):=20=E3=80=8C=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E3=81=AE=E6=96=B0=E8=A6=8F=E6=8A=95=E7=A8=BF?= =?UTF-8?q?=E3=80=8D=E3=81=AE=E9=80=9A=E7=9F=A5=E8=A8=AD=E5=AE=9A=E3=82=92?= =?UTF-8?q?=E5=88=87=E3=82=8A=E6=9B=BF=E3=81=88=E3=82=8B=E3=81=A8=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E5=86=85=E9=83=A8=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=81=8C=E5=87=BA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #11892 --- .../1695605508898-mutingNotificationTypes.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/backend/migration/1695605508898-mutingNotificationTypes.js diff --git a/packages/backend/migration/1695605508898-mutingNotificationTypes.js b/packages/backend/migration/1695605508898-mutingNotificationTypes.js new file mode 100644 index 0000000000..8c0e52a2f0 --- /dev/null +++ b/packages/backend/migration/1695605508898-mutingNotificationTypes.js @@ -0,0 +1,21 @@ +export class MutingNotificationTypes1695605508898 { + name = 'MutingNotificationTypes1695605508898' + + async up(queryRunner) { + await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" RENAME TO "user_profile_mutingnotificationtypes_enum_old"`); + await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum" AS ENUM('note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app', 'test', 'pollVote', 'groupInvited')`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum"[]`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`); + await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum_old"`); + } + + async down(queryRunner) { + await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum_old" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'achievementEarned', 'app')`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum_old"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum_old"[]`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`); + await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum"`); + await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum_old" RENAME TO "user_profile_mutingnotificationtypes_enum"`); + } +} From 89edf8f81eb69aad50b2e4c202b06bbe3a36044c Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 25 Sep 2023 10:35:34 +0900 Subject: [PATCH 6/9] 2023.9.1 --- CHANGELOG.md | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2703ef2aac..26013c14df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ --> -## (unreleased) +## 2023.9.1 + ### General - Enhance: モデレーションログ機能の強化 @@ -21,6 +22,7 @@ ### Server - Fix: お知らせのページネーションが機能しない +- Fix: 「ユーザーの新規投稿」の通知設定を切り替えるとサーバー内部エラーが出る ## 2023.9.0 diff --git a/package.json b/package.json index 67e41b6de6..eb82b503a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2023.9.0", + "version": "2023.9.1", "codename": "nasubi", "repository": { "type": "git", From ee44f35feab7151630d7db5cd61286d3836506f3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 25 Sep 2023 13:57:09 +0900 Subject: [PATCH 7/9] [skip ci] New Crowdin updates (#11891) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Italian) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Italian) * New translations ja-jp.yml (German) * New translations ja-jp.yml (Chinese Simplified) * New translations ja-jp.yml (English) * New translations ja-jp.yml (Chinese Traditional) * New translations ja-jp.yml (Chinese Traditional) --- locales/de-DE.yml | 2 +- locales/en-US.yml | 2 +- locales/it-IT.yml | 38 +++++++++++++++++++++++--------------- locales/zh-CN.yml | 2 +- locales/zh-TW.yml | 31 ++++++++++++++++++------------- 5 files changed, 44 insertions(+), 31 deletions(-) diff --git a/locales/de-DE.yml b/locales/de-DE.yml index 98afd4db4c..aae5f45046 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -2101,9 +2101,9 @@ _webhookSettings: reaction: "Wenn du eine Reaktion erhältst" mention: "Wenn du erwähnt wirst" _moderationLogTypes: + updateRole: "Rolle aktualisiert" assignRole: "Zu Rolle zugewiesen" unassignRole: "Aus Rolle entfernt" - updateRole: "Rolle aktualisiert" suspend: "Gesperrt" unsuspend: "Entsperrt" addCustomEmoji: "Benutzerdefiniertes Emoji hinzugefügt" diff --git a/locales/en-US.yml b/locales/en-US.yml index 75acf424be..920995a954 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -2101,9 +2101,9 @@ _webhookSettings: reaction: "When receiving a reaction" mention: "When being mentioned" _moderationLogTypes: + updateRole: "Role updated" assignRole: "Assigned to role" unassignRole: "Removed from role" - updateRole: "Role updated" suspend: "Suspended" unsuspend: "Unsuspended" addCustomEmoji: "Custom emoji added" diff --git a/locales/it-IT.yml b/locales/it-IT.yml index b700fb8777..e99a41b75c 100644 --- a/locales/it-IT.yml +++ b/locales/it-IT.yml @@ -2031,7 +2031,7 @@ _notification: _types: all: "Tutto" note: "Nuove Note" - follow: "Novità follower" + follow: "Nuovi profili follower" mention: "Menzioni" reply: "Risposte" renote: "Rinota" @@ -2101,18 +2101,26 @@ _webhookSettings: reaction: "Quando ricevo una reazione" mention: "Quando mi menzionano" _moderationLogTypes: - assignRole: "Assegna un ruolo" - unassignRole: "Disassegna un ruolo" - updateRole: "Aggiorna un ruolo" + updateRole: "Ruolo aggiornato" + assignRole: "Ruolo assegnato" + unassignRole: "Ruolo disassegnato" suspend: "Sospensione" - unsuspend: "Toglie la sospensione" - addCustomEmoji: "Aggiunge una emoji personalizzata" - updateServerSettings: "Aggiorna le impostazioni del server" - updateUserNote: "Aggiorna il promemoria di moderazione" - deleteDriveFile: "Elimina file da Drive" - deleteNote: "Elimina la Nota" - createGlobalAnnouncement: "Crea un annuncio globale" - createUserAnnouncement: "Crea un annuncio ai profili iscritti" - resetPassword: "Ripristina la password" - suspendRemoteInstance: "Sospendi istanza remota" - unsuspendRemoteInstance: "Riattiva istanza remota" + unsuspend: "Sospensione rimossa" + addCustomEmoji: "Emoji personalizzata aggiunta" + updateCustomEmoji: "Emoji personalizzata aggiornata" + deleteCustomEmoji: "Emoji personalizzata eliminata" + updateServerSettings: "Impostazioni del server aggiornate" + updateUserNote: "Promemoria di moderazione aggiornato" + deleteDriveFile: "File da Drive eliminato" + deleteNote: "Nota eliminata" + createGlobalAnnouncement: "Annuncio globale creato" + createUserAnnouncement: "Annuncio ai profili iscritti creato" + updateGlobalAnnouncement: "Annuncio globale aggiornato" + updateUserAnnouncement: "Annuncio ai profili iscritti aggiornato" + deleteGlobalAnnouncement: "Annuncio globale eliminato" + deleteUserAnnouncement: "Annuncio ai profili iscritti eliminato" + resetPassword: "Password azzerata" + suspendRemoteInstance: "Istanza remota sospesa" + unsuspendRemoteInstance: "Istanza remota riattivata" + markSensitiveDriveFile: "File nel Drive segnato come esplicito" + unmarkSensitiveDriveFile: "File nel Drive segnato come non esplicito" diff --git a/locales/zh-CN.yml b/locales/zh-CN.yml index bd03dba185..27f95eb377 100644 --- a/locales/zh-CN.yml +++ b/locales/zh-CN.yml @@ -2101,9 +2101,9 @@ _webhookSettings: reaction: "被回应时" mention: "被提及时" _moderationLogTypes: + updateRole: "更新角色" assignRole: "分配角色" unassignRole: "取消分配角色" - updateRole: "更新角色" suspend: "冻结" unsuspend: "解除冻结" addCustomEmoji: "添加自定义表情符号" diff --git a/locales/zh-TW.yml b/locales/zh-TW.yml index cd6473aebd..7cea244098 100644 --- a/locales/zh-TW.yml +++ b/locales/zh-TW.yml @@ -1,6 +1,6 @@ --- -_lang_: "繁體中文" -headlineMisskey: "貼文連繫網絡" +_lang_: "繁體中文(台灣)" +headlineMisskey: "貼文連繫網路" introMisskey: "歡迎!Misskey 是一個開放原始碼且去中心化的社群網路服務。\n發布「貼文」向身邊的人分享您的想法!📡\n利用「反應」表達您對貼文的感覺!👍\n讓我們一起探索新的世界吧!🚀" poweredByMisskeyDescription: "{name}是開放原始碼平臺 Misskey 的伺服器之一。" monthAndDay: "{month} 月 {day} 日" @@ -45,7 +45,7 @@ pin: "置頂" unpin: "取消置頂" copyContent: "複製內容" copyLink: "複製連結" -copyLinkRenote: "複製轉貼連結" +copyLinkRenote: "複製轉發的連結" delete: "刪除" deleteAndEdit: "刪除並編輯" deleteAndEditConfirm: "要刪除並再次編輯嗎?此貼文的所有反應、轉發和回覆也將會消失。" @@ -107,7 +107,7 @@ followRequestPending: "追隨許可待批准" enterEmoji: "輸入表情符號" renote: "轉發" unrenote: "取消轉發" -renoted: "轉發成功" +renoted: "轉發成功。" cantRenote: "無法轉發此貼文。" cantReRenote: "無法轉發之前已經轉發過的內容。" quote: "引用" @@ -138,8 +138,8 @@ suspend: "凍結" unsuspend: "解除凍結" blockConfirm: "確定要封鎖此使用者嗎?" unblockConfirm: "確定要解除封鎖此使用者嗎?" -suspendConfirm: "確定凍結此帳戶?" -unsuspendConfirm: "確定解凍此帳戶?" +suspendConfirm: "確定凍結此使用者?" +unsuspendConfirm: "確定解凍此使用者?" selectList: "選擇清單" editList: "編輯清單" selectChannel: "選擇頻道" @@ -152,12 +152,12 @@ customEmojis: "自訂表情符號" emoji: "表情符號" emojis: "表情符號" emojiName: "表情符號名稱" -emojiUrl: "表情符號URL" +emojiUrl: "表情符號 URL" addEmoji: "新增表情符號" settingGuide: "推薦設定" cacheRemoteFiles: "快取遠端檔案" -cacheRemoteFilesDescription: "禁用此設定會停止建立遠端檔案快取,從而節省伺服器儲存空間,但會因從遠端讀取資料而增加網路數據用量。" -youCanCleanRemoteFilesCache: "按檔案管理的🗑️按鈕,將快取全部刪除。" +cacheRemoteFilesDescription: "啟用此設定後,遠端檔案會被快取在本伺服器的儲存空間中。雖然顯示圖片會變快,但會消耗較多伺服器的儲存空間。至於要快取遠端使用者到什麼程度,是依照角色的雲端硬碟容量而定。當超過這個限制時,從較舊的檔案開始自快取中刪除並改為連結。關閉這個設定時,遠端檔案從一開始就維持連結的方式,但為了產生圖片的縮圖並保護使用者的隱私,建議將 default.yml 的 proxyRemoteFiles 設為 true。" +youCanCleanRemoteFilesCache: "按檔案管理的🗑️按鈕,可將快取全部刪除。" cacheRemoteSensitiveFiles: "快取遠端的敏感檔案" cacheRemoteSensitiveFilesDescription: "若停用這個設定,則不會快取遠端的敏感檔案,而是直接連結。" flagAsBot: "此使用者是機器人" @@ -424,7 +424,7 @@ securityKeyAndPasskey: "安全金鑰、Passkey" securityKey: "安全金鑰" lastUsed: "上次使用" lastUsedAt: "上次使用:{t}" -unregister: "註銷帳戶" +unregister: "註銷" passwordLessLogin: "設置無密碼登入" passwordLessLoginDescription: "不使用密碼,以安全金鑰或 Passkey 登入" resetPassword: "重設密碼" @@ -509,8 +509,8 @@ promote: "推廣" numberOfDays: "有效天數" hideThisNote: "隱藏此貼文" showFeaturedNotesInTimeline: "在時間軸上顯示熱門推薦" -objectStorage: "對象存儲" -useObjectStorage: "使用對象存儲" +objectStorage: "物件儲存" +useObjectStorage: "使用物件儲存" objectStorageBaseUrl: "Base URL" objectStorageBaseUrlDesc: "用於引用的 URL。如果您使用的是 CDN 或反向代理,請指定其 URL,例如 S3(https://.s3.amazonaws.com)、GCS(https://storage.googleapis.com/)。" objectStorageBucket: "儲存空間(Bucket)" @@ -1120,6 +1120,7 @@ notifyNotes: "開啟貼文通知" unnotifyNotes: "關閉貼文通知" authentication: "驗證" authenticationRequiredToContinue: "請於繼續前完成驗證" +dateAndTime: "日期與時間" _announcement: forExistingUsers: "僅限既有的使用者" forExistingUsersDescription: "啟用代表僅向現存使用者顯示;停用代表張貼後註冊的新使用者也會看到。" @@ -2101,9 +2102,11 @@ _webhookSettings: reaction: "當獲得反應時" mention: "當被提到時" _moderationLogTypes: + createRole: "新增角色" + deleteRole: "刪除角色 " + updateRole: "更新角色設定" assignRole: "指派角色" unassignRole: "撤銷角色" - updateRole: "更新角色設定" suspend: "凍結" unsuspend: "解除凍結" addCustomEmoji: "新增自訂表情符號" @@ -2122,3 +2125,5 @@ _moderationLogTypes: resetPassword: "重設密碼" suspendRemoteInstance: "封鎖遠端伺服器" unsuspendRemoteInstance: "解除封鎖遠端伺服器" + markSensitiveDriveFile: "標記為敏感檔案" + unmarkSensitiveDriveFile: "撤銷標記為敏感檔案" From bd19d75c9c49d601cbf29e2fdcd67f3864b74175 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 25 Sep 2023 16:03:43 +0900 Subject: [PATCH 8/9] enhance: improve moderation log --- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + .../api/endpoints/admin/resolve-abuse-user-report.ts | 8 ++++++++ packages/backend/src/types.ts | 6 ++++++ packages/frontend/src/pages/admin/modlog.ModLog.vue | 5 +++++ packages/misskey-js/etc/misskey-js.api.md | 2 +- packages/misskey-js/src/consts.ts | 6 ++++++ 7 files changed, 28 insertions(+), 1 deletion(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 5e24ecffa5..4d8123eb5d 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -2276,6 +2276,7 @@ export interface Locale { "unsuspendRemoteInstance": string; "markSensitiveDriveFile": string; "unmarkSensitiveDriveFile": string; + "resolveAbuseReport": string; }; } declare const locales: { diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1af73c6201..647f5fb5f0 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -2189,3 +2189,4 @@ _moderationLogTypes: unsuspendRemoteInstance: "リモートサーバーを再開" markSensitiveDriveFile: "ファイルをセンシティブ付与" unmarkSensitiveDriveFile: "ファイルをセンシティブ解除" + resolveAbuseReport: "通報を解決" diff --git a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts index 8667640a67..fb5ac7a335 100644 --- a/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts +++ b/packages/backend/src/server/api/endpoints/admin/resolve-abuse-user-report.ts @@ -10,6 +10,7 @@ import { InstanceActorService } from '@/core/InstanceActorService.js'; import { QueueService } from '@/core/QueueService.js'; import { ApRendererService } from '@/core/activitypub/ApRendererService.js'; import { DI } from '@/di-symbols.js'; +import { ModerationLogService } from '@/core/ModerationLogService.js'; export const meta = { tags: ['admin'], @@ -41,6 +42,7 @@ export default class extends Endpoint { // eslint- private queueService: QueueService, private instanceActorService: InstanceActorService, private apRendererService: ApRendererService, + private moderationLogService: ModerationLogService, ) { super(meta, paramDef, async (ps, me) => { const report = await this.abuseUserReportsRepository.findOneBy({ id: ps.reportId }); @@ -61,6 +63,12 @@ export default class extends Endpoint { // eslint- assigneeId: me.id, forwarded: ps.forward && report.targetUserHost != null, }); + + this.moderationLogService.log(me, 'resolveAbuseReport', { + reportId: report.id, + report: report, + forwarded: ps.forward && report.targetUserHost != null, + }); }); } } diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index b458c0fbcb..35ea710f9e 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -55,6 +55,7 @@ export const moderationLogTypes = [ 'unsuspendRemoteInstance', 'markSensitiveDriveFile', 'unmarkSensitiveDriveFile', + 'resolveAbuseReport', ] as const; export type ModerationLogPayloads = { @@ -192,4 +193,9 @@ export type ModerationLogPayloads = { fileUserUsername: string | null; fileUserHost: string | null; }; + resolveAbuseReport: { + reportId: string; + report: any; + forwarded: boolean; + }; }; diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue index f0de026ad8..14f94479f1 100644 --- a/packages/frontend/src/pages/admin/modlog.ModLog.vue +++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue @@ -75,6 +75,11 @@ SPDX-License-Identifier: AGPL-3.0-only + +
+ raw +
{{ JSON5.stringify(log, null, '\t') }}
+
diff --git a/packages/misskey-js/etc/misskey-js.api.md b/packages/misskey-js/etc/misskey-js.api.md index f72532f297..0686354ff4 100644 --- a/packages/misskey-js/etc/misskey-js.api.md +++ b/packages/misskey-js/etc/misskey-js.api.md @@ -2607,7 +2607,7 @@ type ModerationLog = { }); // @public (undocumented) -export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile"]; +export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport"]; // @public (undocumented) export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index d2751c447e..aedfb5570e 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -73,6 +73,7 @@ export const moderationLogTypes = [ 'unsuspendRemoteInstance', 'markSensitiveDriveFile', 'unmarkSensitiveDriveFile', + 'resolveAbuseReport', ] as const; export type ModerationLogPayloads = { @@ -210,4 +211,9 @@ export type ModerationLogPayloads = { fileUserUsername: string | null; fileUserHost: string | null; }; + resolveAbuseReport: { + reportId: string; + report: any; + forwarded: boolean; + }; }; From 2039e244c5c1ef4e68e16292e9d19e3d94629d5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:05:02 +0900 Subject: [PATCH 9/9] build(deps): bump actions/checkout from 4.0.0 to 4.1.0 (#11900) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/api-misskey-js.yml | 2 +- .github/workflows/check_copyright_year.yml | 2 +- .github/workflows/docker-develop.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/dockle.yml | 2 +- .github/workflows/lint.yml | 6 +++--- .github/workflows/pr-preview-deploy.yml | 2 +- .github/workflows/test-backend.yml | 2 +- .github/workflows/test-frontend.yml | 4 ++-- .github/workflows/test-misskey-js.yml | 2 +- .github/workflows/test-production.yml | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/api-misskey-js.yml b/.github/workflows/api-misskey-js.yml index 4cf523a6b9..39f29bf773 100644 --- a/.github/workflows/api-misskey-js.yml +++ b/.github/workflows/api-misskey-js.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - run: corepack enable diff --git a/.github/workflows/check_copyright_year.yml b/.github/workflows/check_copyright_year.yml index 313265f671..fb04cf1b00 100644 --- a/.github/workflows/check_copyright_year.yml +++ b/.github/workflows/check_copyright_year.yml @@ -10,7 +10,7 @@ jobs: check_copyright_year: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 - run: | if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then echo "Please change copyright year!" diff --git a/.github/workflows/docker-develop.yml b/.github/workflows/docker-develop.yml index 05bb7f77f9..3e5bb17902 100644 --- a/.github/workflows/docker-develop.yml +++ b/.github/workflows/docker-develop.yml @@ -13,7 +13,7 @@ jobs: if: github.repository == 'misskey-dev/misskey' steps: - name: Check out the repo - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 32a98a416d..33c85cbaf4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Check out the repo - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.yml index d811944d61..2a1ac3a16c 100644 --- a/.github/workflows/dockle.yml +++ b/.github/workflows/dockle.yml @@ -14,7 +14,7 @@ jobs: env: DOCKER_CONTENT_TRUST: 1 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 - run: | curl -L -o dockle.deb "https://github.com/goodwithtech/dockle/releases/download/v0.4.10/dockle_0.4.10_Linux-64bit.deb" sudo dpkg -i dockle.deb diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7c10c23e77..798e6f49a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: pnpm_install: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true @@ -38,7 +38,7 @@ jobs: - sw - misskey-js steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true @@ -64,7 +64,7 @@ jobs: - backend - misskey-js steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: fetch-depth: 0 submodules: true diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 702d8917e3..44f97645d0 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -53,7 +53,7 @@ jobs: # Check out merge commit - name: Fork based /deploy checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 with: ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge' diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index 19496c8959..ac7d1afda1 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -29,7 +29,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 0618a0ef0a..e67b516546 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -16,7 +16,7 @@ jobs: node-version: [20.5.1] steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm @@ -68,7 +68,7 @@ jobs: - 56312:6379 steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true # https://github.com/cypress-io/cypress-docker-images/issues/150 diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 7999c183b1..1846b628d3 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.0.0 + uses: actions/checkout@v4.1.0 - run: corepack enable diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index 0504f42d16..c570018962 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -19,7 +19,7 @@ jobs: node-version: [20.5.1] steps: - - uses: actions/checkout@v4.0.0 + - uses: actions/checkout@v4.1.0 with: submodules: true - name: Install pnpm