diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 71c0c0a55d..8291db9b42 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -228,7 +228,13 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis - public async create(user: MiUser, data: Option, silent = false): Promise { + public async create(user: MiUser & { + id: MiUser['id']; + username: MiUser['username']; + host: MiUser['host']; + isBot: MiUser['isBot']; + noindex: MiUser['noindex']; + }, data: Option, silent = false): Promise { // チャンネル外にリプライしたら対象のスコープに合わせる // (クライアントサイドでやっても良い処理だと思うけどとりあえずサーバーサイドで) if (data.reply && data.channel && data.reply.channelId !== data.channel.id) { @@ -429,7 +435,13 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis - public async import(user: MiUser, data: Option): Promise { + public async import(user: MiUser & { + id: MiUser['id']; + username: MiUser['username']; + host: MiUser['host']; + isBot: MiUser['isBot']; + noindex: MiUser['noindex']; + }, data: Option): Promise { return this.create(user, data, true); } @@ -540,7 +552,13 @@ export class NoteCreateService implements OnApplicationShutdown { } @bindThis - private async postNoteCreated(note: MiNote, user: MiUser, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) { + private async postNoteCreated(note: MiNote, user: MiUser & { + id: MiUser['id']; + username: MiUser['username']; + host: MiUser['host']; + isBot: MiUser['isBot']; + noindex: MiUser['noindex']; + }, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) { this.notesChart.update(note, true); if (note.visibility !== 'specified' && (this.meta.enableChartsForRemoteUser || (user.host == null))) { this.perUserNotesChart.update(user, note, true); diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index 854112ec1d..24a99156d2 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -224,7 +224,13 @@ export class NoteEditService implements OnApplicationShutdown { } @bindThis - public async edit(user: MiUser, editid: MiNote['id'], data: Option, silent = false): Promise { + public async edit(user: MiUser & { + id: MiUser['id']; + username: MiUser['username']; + host: MiUser['host']; + isBot: MiUser['isBot']; + noindex: MiUser['noindex']; + }, editid: MiNote['id'], data: Option, silent = false): Promise { if (!editid) { throw new Error('fail'); } @@ -578,7 +584,13 @@ export class NoteEditService implements OnApplicationShutdown { } @bindThis - private async postNoteEdited(note: MiNote, oldNote: MiNote, user: MiUser, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) { + private async postNoteEdited(note: MiNote, oldNote: MiNote, user: MiUser & { + id: MiUser['id']; + username: MiUser['username']; + host: MiUser['host']; + isBot: MiUser['isBot']; + noindex: MiUser['noindex']; + }, data: Option, silent: boolean, tags: string[], mentionedUsers: MinimumUser[]) { // Register host if (this.meta.enableStatsForFederatedInstances) { if (this.userEntityService.isRemoteUser(user)) {