diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-24 10:33:30 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-24 10:33:30 +0900 |
| commit | 2ad3b1fd74f20698be13a4beb5ee4b818ea0f090 (patch) | |
| tree | 23b37a184f7e98fa4d7af49c44259f90565d3012 /packages/backend/src/core/RoleService.ts | |
| parent | fix: ノート通知で絵文字が使われている名前が絵文字で表... (diff) | |
| download | sharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.tar.gz sharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.tar.bz2 sharkey-2ad3b1fd74f20698be13a4beb5ee4b818ea0f090.zip | |
improve moderation log
Diffstat (limited to 'packages/backend/src/core/RoleService.ts')
| -rw-r--r-- | packages/backend/src/core/RoleService.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 39f21ecec4..dea6dc68cd 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -494,6 +494,19 @@ export class RoleService implements OnApplicationShutdown { } @bindThis + public async delete(role: MiRole, moderator?: MiUser): Promise<void> { + await this.rolesRepository.delete({ id: role.id }); + this.globalEventService.publishInternalEvent('roleDeleted', role); + + if (moderator) { + this.moderationLogService.log(moderator, 'deleteRole', { + roleId: role.id, + role: role, + }); + } + } + + @bindThis public dispose(): void { this.redisForSub.off('message', this.onMessage); this.roleAssignmentByUserIdCache.dispose(); |