From 09a846a45c5243200abdc6995229ca0be678a79a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 24 Mar 2023 18:55:31 +0900 Subject: enhance(backend): use :heart: for reaction fallback --- packages/backend/src/core/ReactionService.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'packages/backend/src/core/ReactionService.ts') diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index f13e9ba15c..b3aea878d6 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -21,6 +21,8 @@ import { bindThis } from '@/decorators.js'; import { UtilityService } from '@/core/UtilityService.js'; import { UserBlockingService } from '@/core/UserBlockingService.js'; +const FALLBACK = '❀'; + const legacies: Record = { 'like': 'πŸ‘', 'love': '❀', // γ“γ“γ«θ¨˜θΏ°γ™γ‚‹ε ΄εˆγ―η•°δ½“ε­—γ‚»γƒ¬γ‚―γ‚Ώγ‚’ε…₯γ‚Œγͺい @@ -255,12 +257,6 @@ export class ReactionService { //#endregion } - @bindThis - public async getFallbackReaction(): Promise { - const meta = await this.metaService.fetch(); - return meta.useStarForReactionFallback ? '⭐' : 'πŸ‘'; - } - @bindThis public convertLegacyReactions(reactions: Record) { const _reactions = {} as Record; @@ -294,7 +290,7 @@ export class ReactionService { @bindThis public async toDbReaction(reaction?: string | null, reacterHost?: string | null): Promise { - if (reaction == null) return await this.getFallbackReaction(); + if (reaction == null) return FALLBACK; reacterHost = this.utilityService.toPunyNullable(reacterHost); @@ -322,7 +318,7 @@ export class ReactionService { if (emoji) return reacterHost ? `:${name}@${reacterHost}:` : `:${name}:`; } - return await this.getFallbackReaction(); + return FALLBACK; } @bindThis -- cgit v1.2.3-freya