diff --git a/locales/index.d.ts b/locales/index.d.ts index 7314585b631d..e0d660ce1f51 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -52,6 +52,7 @@ export interface Locale { "delete": string; "deleteAndEdit": string; "deleteAndEditConfirm": string; + "makeNoteHome": string; "addToList": string; "addToAntenna": string; "sendMessage": string; @@ -232,6 +233,7 @@ export interface Locale { "noUsers": string; "editProfile": string; "noteDeleteConfirm": string; + "makeNoteHomeConfirm": string; "pinLimitExceeded": string; "intro": string; "done": string; @@ -2470,6 +2472,7 @@ export interface Locale { "deleteAvatarDecoration": string; "unsetUserAvatar": string; "unsetUserBanner": string; + "makeNoteHome": string; }; "_fileViewer": { "title": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index d8055efdd66b..fb049fc6efe2 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -49,6 +49,7 @@ copyLinkRenote: "リノートのリンクをコピー" delete: "削除" deleteAndEdit: "削除して編集" deleteAndEditConfirm: "このノートを削除してもう一度編集しますか?このノートへのリアクション、リノート、返信も全て削除されます。" +makeNoteHome: "ホーム投稿にする" addToList: "リストに追加" addToAntenna: "アンテナに追加" sendMessage: "メッセージを送信" @@ -229,6 +230,7 @@ blockedUsers: "ブロックしたユーザー" noUsers: "ユーザーはいません" editProfile: "プロフィールを編集" noteDeleteConfirm: "このノートを削除しますか?" +makeNoteHomeConfirm: "本当にホーム投稿にしますか?" pinLimitExceeded: "これ以上ピン留めできません" intro: "Misskeyのインストールが完了しました!管理者アカウントを作成しましょう。" done: "完了" @@ -2371,6 +2373,7 @@ _moderationLogTypes: deleteAvatarDecoration: "アイコンデコレーションを削除" unsetUserAvatar: "ユーザーのアイコンを解除" unsetUserBanner: "ユーザーのバナーを解除" + makeNoteHome: "ノートをホーム投稿に変更" _fileViewer: title: "ファイルの詳細" diff --git a/packages/backend/src/server/api/endpoints/admin/note-public-to-home.ts b/packages/backend/src/server/api/endpoints/admin/note-public-to-home.ts index 16186560b427..ad7c6af720c2 100644 --- a/packages/backend/src/server/api/endpoints/admin/note-public-to-home.ts +++ b/packages/backend/src/server/api/endpoints/admin/note-public-to-home.ts @@ -6,7 +6,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DataSource } from 'typeorm'; import * as Redis from 'ioredis'; -import type { NotesRepository } from '@/models/_.js'; +import type { NotesRepository, UsersRepository } from '@/models/_.js'; import { MiNote, MiPoll } from '@/models/_.js'; import { Endpoint } from '@/server/api/endpoint-base.js'; import { DI } from '@/di-symbols.js'; @@ -47,6 +47,9 @@ export const paramDef = { @Injectable() export default class extends Endpoint { // eslint-disable-line import/no-default-export constructor( + @Inject(DI.usersRepository) + private usersRepository: UsersRepository, + @Inject(DI.notesRepository) private notesRepository: NotesRepository, @@ -74,7 +77,14 @@ export default class extends Endpoint { // eslint- // Note: by design, visibility of replies and quoted renotes are not changed // replies and quoted renotes have their own text, so it's another moderation entity - await moderationLogService.log(me, 'makeNoteHome', { targetNoteId: note.id }); + const user = await this.usersRepository.findOneByOrFail({ id: note.userId }); + await moderationLogService.log(me, 'makeNoteHome', { + noteId: note.id, + noteUserId: note.userId, + noteUserUsername: user.username, + noteUserHost: user.host, + note: note, + }); // update basic note info await this.db.transaction(async transactionalEntityManager => { diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 42765eb174ca..8c08e592c097 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -269,7 +269,11 @@ export type ModerationLogPayloads = { fileId: string; }; makeNoteHome: { - targetNoteId: string; + noteId: string; + noteUserId: string; + noteUserUsername: string; + noteUserHost: string | null; + note: any; }; }; diff --git a/packages/frontend/src/pages/admin/modlog.ModLog.vue b/packages/frontend/src/pages/admin/modlog.ModLog.vue index 699b3c425ace..7800c37bb4b7 100644 --- a/packages/frontend/src/pages/admin/modlog.ModLog.vue +++ b/packages/frontend/src/pages/admin/modlog.ModLog.vue @@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._moderationLogTypes[log.type] }} @@ -40,6 +40,7 @@ SPDX-License-Identifier: AGPL-3.0-only : {{ log.info.avatarDecoration.name }} : {{ log.info.before.name }} : {{ log.info.avatarDecoration.name }} + : @{{ log.info.noteUserUsername }}{{ log.info.noteUserHost ? '@' + log.info.noteUserHost : '' }}