improve moderation log

This commit is contained in:
syuilo 2023-09-24 10:33:30 +09:00
parent ed53b5f9bc
commit 2ad3b1fd74
5 changed files with 22 additions and 9 deletions

View file

@ -493,6 +493,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);