From 73f06e591ab1aecd780fd7f1e1181b86c29b3f7e Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 8 Feb 2023 20:07:19 +0900 Subject: revert: 650187deaf --- packages/backend/src/core/CustomEmojiService.ts | 8 ++++++++ packages/backend/src/core/entities/UserEntityService.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/backend/src') diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index 3ac796fb2f..63f0319442 100644 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -150,9 +150,17 @@ export class CustomEmojiService { if (note.renote) { emojis = emojis.concat(note.renote.emojis .map(e => this.parseEmojiStr(e, note.renote!.userHost))); + if (note.renote.user) { + emojis = emojis.concat(note.renote.user.emojis + .map(e => this.parseEmojiStr(e, note.renote!.userHost))); + } } const customReactions = Object.keys(note.reactions).map(x => this.reactionService.decodeReaction(x)).filter(x => x.name != null) as typeof emojis; emojis = emojis.concat(customReactions); + if (note.user) { + emojis = emojis.concat(note.user.emojis + .map(e => this.parseEmojiStr(e, note.userHost))); + } } return emojis.filter(x => x.name != null && x.host != null) as { name: string; host: string; }[]; } diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 09b69d509a..eea9d5567d 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -413,6 +413,7 @@ export class UserEntityService implements OnModuleInit { faviconUrl: instance.faviconUrl, themeColor: instance.themeColor, } : undefined) : undefined, + emojis: this.customEmojiService.populateEmojis(user.emojis, user.host), onlineStatus: this.getOnlineStatus(user), // パフォーマンス上の理由でローカルユーザーのみ badgeRoles: user.host == null ? this.roleService.getUserBadgeRoles(user.id).then(rs => rs.map(r => ({ @@ -463,7 +464,6 @@ export class UserEntityService implements OnModuleInit { isModerator: role.isModerator, isAdministrator: role.isAdministrator, }))), - emojis: this.customEmojiService.populateEmojis(user.emojis, user.host), } : {}), ...(opts.detail && isMe ? { -- cgit v1.2.3-freya