diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-24 18:55:31 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-24 18:55:31 +0900 |
| commit | 09a846a45c5243200abdc6995229ca0be678a79a (patch) | |
| tree | 0aabd16d2fd05317c22a4d4d2578fc079a153391 /packages/backend/src/core/ReactionService.ts | |
| parent | enhance of f01e6ef6bf (diff) | |
| download | sharkey-09a846a45c5243200abdc6995229ca0be678a79a.tar.gz sharkey-09a846a45c5243200abdc6995229ca0be678a79a.tar.bz2 sharkey-09a846a45c5243200abdc6995229ca0be678a79a.zip | |
enhance(backend): use :heart: for reaction fallback
Diffstat (limited to 'packages/backend/src/core/ReactionService.ts')
| -rw-r--r-- | packages/backend/src/core/ReactionService.ts | 12 |
1 files changed, 4 insertions, 8 deletions
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<string, string> = { 'like': 'π', 'love': 'β€', // γγγ«θ¨θΏ°γγε ΄εγ―η°δ½εγ»γ¬γ―γΏγε
₯γγͺγ @@ -256,12 +258,6 @@ export class ReactionService { } @bindThis - public async getFallbackReaction(): Promise<string> { - const meta = await this.metaService.fetch(); - return meta.useStarForReactionFallback ? 'β' : 'π'; - } - - @bindThis public convertLegacyReactions(reactions: Record<string, number>) { const _reactions = {} as Record<string, number>; @@ -294,7 +290,7 @@ export class ReactionService { @bindThis public async toDbReaction(reaction?: string | null, reacterHost?: string | null): Promise<string> { - 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 |