enhance: improve moderation log

This commit is contained in:
syuilo 2023-09-25 10:29:12 +09:00
parent 646a8d1a54
commit 5318532a8d
19 changed files with 209 additions and 60 deletions

View file

@ -134,11 +134,11 @@ export class CustomEmojiService implements OnApplicationShutdown {
this.localEmojisCache.refresh();
const updated = await this.emojiEntityService.packDetailed(emoji.id);
const packed = await this.emojiEntityService.packDetailed(emoji.id);
if (emoji.name === data.name) {
this.globalEventService.publishBroadcastStream('emojiUpdated', {
emojis: [updated],
emojis: [packed],
});
} else {
this.globalEventService.publishBroadcastStream('emojiDeleted', {
@ -146,11 +146,12 @@ export class CustomEmojiService implements OnApplicationShutdown {
});
this.globalEventService.publishBroadcastStream('emojiAdded', {
emoji: updated,
emoji: packed,
});
}
if (moderator) {
const updated = await this.emojisRepository.findOneByOrFail({ id: id });
this.moderationLogService.log(moderator, 'updateCustomEmoji', {
emojiId: emoji.id,
before: emoji,