feat(ui): warn before sending plugin-only symbols

This commit is contained in:
2026-05-22 16:41:06 +02:00
parent a6e2a75422
commit ba4cd918da
5 changed files with 109 additions and 7 deletions
@@ -0,0 +1,30 @@
namespace HellionChat._Helpers;
// UI-11 pure decision helper: does a message about to be sent carry a glyph
// that only renders correctly for players running HellionChat or a similar
// plugin? Those are FFXIV Private-Use-Area icon codepoints (the same range
// SeIconChar covers); a recipient without a plugin sees an empty box.
//
// Works on raw char codepoints on purpose: SeIconChar is a Dalamud type, and a
// helper that touched it could not run in the xUnit AppDomain
// (feedback_dalamud_test_isolation, point 7).
// TEST-MIRROR: ../../../Hellion Build test/Ui/PluginDisclosureScannerTests.cs
public static class PluginDisclosureScanner
{
// FFXIV packs its icon glyphs into this slice of the Unicode Private Use
// Area. The whole range is inside the BMP, so a single char per codepoint
// is enough — no surrogate-pair handling needed.
private const char PrivateUseFirst = '';
private const char PrivateUseLast = '';
public static bool ContainsPrivateUseGlyph(string text)
{
foreach (var c in text)
{
if (c >= PrivateUseFirst && c <= PrivateUseLast)
return true;
}
return false;
}
}