feat(backend): likeOnlyなどでハートにフォールバックする際異体字セレクタがない方に揃える (#13299)
* feat(backend): likeOnlyなどでハートにフォールバックする際異体字セレクタがない方に揃える close #13298 * Update ReactionService.ts * chore(backend): prefer single quote for string literal
This commit is contained in:
parent
0c10d2aa64
commit
147e8f1e3e
|
@ -30,12 +30,12 @@ import { RoleService } from '@/core/RoleService.js';
|
||||||
import { FeaturedService } from '@/core/FeaturedService.js';
|
import { FeaturedService } from '@/core/FeaturedService.js';
|
||||||
import { trackPromise } from '@/misc/promise-tracker.js';
|
import { trackPromise } from '@/misc/promise-tracker.js';
|
||||||
|
|
||||||
const FALLBACK = '❤';
|
const FALLBACK = '\u2764';
|
||||||
const PER_NOTE_REACTION_USER_PAIR_CACHE_MAX = 16;
|
const PER_NOTE_REACTION_USER_PAIR_CACHE_MAX = 16;
|
||||||
|
|
||||||
const legacies: Record<string, string> = {
|
const legacies: Record<string, string> = {
|
||||||
'like': '👍',
|
'like': '👍',
|
||||||
'love': '❤', // ここに記述する場合は異体字セレクタを入れない
|
'love': '\u2764', // ハート、異体字セレクタを入れない
|
||||||
'laugh': '😆',
|
'laugh': '😆',
|
||||||
'hmm': '🤔',
|
'hmm': '🤔',
|
||||||
'surprise': '😮',
|
'surprise': '😮',
|
||||||
|
@ -120,7 +120,7 @@ export class ReactionService {
|
||||||
let reaction = _reaction ?? FALLBACK;
|
let reaction = _reaction ?? FALLBACK;
|
||||||
|
|
||||||
if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) {
|
if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) {
|
||||||
reaction = '❤️';
|
reaction = '\u2764';
|
||||||
} else if (_reaction) {
|
} else if (_reaction) {
|
||||||
const custom = reaction.match(isCustomEmojiRegexp);
|
const custom = reaction.match(isCustomEmojiRegexp);
|
||||||
if (custom) {
|
if (custom) {
|
||||||
|
|
Loading…
Reference in New Issue