One emoji, one reaction: variation selectors made canonical

A heart reaction arrived as ❤ from some servers and as ❤️ (with the
emoji variation selector) from others, and a persona's own reaction kept
whatever it was given: the same emoji was two reactions, counted apart.
The selector is now dropped and put back only on a symbol that shows as
text without it (U+2000 to U+2BFF), so every heart is ❤️ and every 🔥
is 🔥. Found by the town's Hollo pair.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-05 00:58:48 +02:00
1 parent ed08f80f05
commit f70ec59359
2 files changed
+8

No files matched your search

+5
View File
@@ -178,6 +178,11 @@ namespace PrivaPub.Domain.Social
return requireKnownCustom ? default : new Picked(bare, default);
return new Picked(bare, emoji.URL);
}
// one emoji, one name: ❤ and ❤️ (with the emoji variation selector) were two reactions, counted apart. The selector
// is dropped, then put back on a symbol that shows as text without it (U+2000 to U+2BFF: ❤, ☺, ✌...)
text = text.Replace("\uFE0F", "");
if (text.Length == 1 && text[0] is >= '\u2000' and <= '\u2BFF')
text += "\uFE0F";
if (text.Any(c => c < 128 || char.IsWhiteSpace(c)) || new StringInfo(text).LengthInTextElements != 1)
return default;
return new Picked(text, default);