From 0dbf5175dfea04a9405985faa1d18f8383b58cac Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 4 Oct 2023 19:55:35 +0900 Subject: [PATCH] enhance: improve moderation log --- CHANGELOG.md | 2 ++ packages/backend/src/core/AnnouncementService.ts | 4 ++++ packages/backend/src/types.ts | 3 +++ .../frontend/src/pages/admin/modlog.ModLog.vue | 14 ++++++++++++++ packages/misskey-js/src/consts.ts | 3 +++ 5 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e525ace6a..6959c8577c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ - Feat: ユーザーごとに他ユーザーへの返信をタイムラインに含めるか設定可能になりました - Feat: ユーザーリスト内のメンバーごとに他ユーザーへの返信をユーザーリストタイムラインに含めるか設定可能になりました - Enhance: ソフトワードミュートとハードワードミュートは統合されました +- Enhance: モデレーションログ機能の強化 +- Enhance: ローカリゼーションの更新 ### Client - Enhance: 二要素認証のバックアップコード一覧をテキストファイルでダウンロード可能に diff --git a/packages/backend/src/core/AnnouncementService.ts b/packages/backend/src/core/AnnouncementService.ts index ddacc0936f..a5330db53f 100644 --- a/packages/backend/src/core/AnnouncementService.ts +++ b/packages/backend/src/core/AnnouncementService.ts @@ -158,9 +158,13 @@ export class AnnouncementService { if (moderator) { if (announcement.userId) { + const user = await this.usersRepository.findOneByOrFail({ id: announcement.userId }); this.moderationLogService.log(moderator, 'deleteUserAnnouncement', { announcementId: announcement.id, announcement: announcement, + userId: announcement.userId, + userUsername: user.username, + userHost: user.host, }); } else { this.moderationLogService.log(moderator, 'deleteGlobalAnnouncement', { diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index a9b9a55bc0..316073c992 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -171,6 +171,9 @@ export type ModerationLogPayloads = { deleteUserAnnouncement: { announcementId: string; announcement: any; + userId: string; + userUsername: string; + userHost: string | null; }; resetPassword: { userId: string; diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue index 66561c969e..0af226f02e 100644 --- a/packages/frontend/src/pages/admin/modlog.ModLog.vue +++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue @@ -29,8 +29,12 @@ SPDX-License-Identifier: AGPL-3.0-only : @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }} : {{ log.info.host }} : {{ log.info.host }} + : {{ log.info.announcement.title }} + : {{ log.info.before.title }} + : {{ log.info.announcement.title }} : @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} : @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} + : @{{ log.info.userUsername }}{{ log.info.userHost ? '@' + log.info.userHost : '' }} : @{{ log.info.noteUserUsername }}{{ log.info.noteUserHost ? '@' + log.info.noteUserHost : '' }} : @{{ log.info.fileUserUsername }}{{ log.info.fileUserHost ? '@' + log.info.fileUserHost : '' }} @@ -88,6 +92,16 @@ SPDX-License-Identifier: AGPL-3.0-only + +
raw diff --git a/packages/misskey-js/src/consts.ts b/packages/misskey-js/src/consts.ts index 271a64274f..ccc55537d2 100644 --- a/packages/misskey-js/src/consts.ts +++ b/packages/misskey-js/src/consts.ts @@ -189,6 +189,9 @@ export type ModerationLogPayloads = { deleteUserAnnouncement: { announcementId: string; announcement: any; + userId: string; + userUsername: string; + userHost: string | null; }; resetPassword: { userId: string;