Files
HellionChat/HellionChat/Privacy/PrivacyDefaults.cs
T
JonKazama-Hellion 58e754c169 feat(privacy): default PrivacyPersistUnknownChannels to true for new configs
F3.1: future FFXIV patches can add new ChatTypes that aren't on any
existing whitelist. With the field defaulted to false a new install
would silently drop those channels until the user opts in. New configs
now start with PrivacyPersistUnknownChannels=true via a constant in
PrivacyDefaults. Existing configs keep their explicit choice — the
deserializer overrides the initializer, so no migration and no schema
bump.
2026-05-12 09:41:52 +02:00

118 lines
4.2 KiB
C#

using HellionChat.Code;
namespace HellionChat.Privacy;
internal static class PrivacyDefaults
{
// F3.1: failsafe for ChatTypes added by future FFXIV patches. New installs
// persist unknown channels so a major patch's added ChatType isn't silently
// dropped before the user can opt in or out. Existing configs keep their
// explicit choice — see Configuration.cs PrivacyPersistUnknownChannels.
internal const bool DefaultPersistUnknownChannels = true;
// DSGVO Art. 25 (Privacy by Default): only the player's own conversations
// are persisted out-of-the-box. Public chat, NPC dialogue, system logs and
// battle messages require explicit opt-in.
internal static readonly IReadOnlySet<ChatType> PrivacyFirstWhitelist = new HashSet<ChatType>
{
ChatType.TellIncoming,
ChatType.TellOutgoing,
ChatType.Party,
ChatType.CrossParty,
ChatType.Alliance,
ChatType.FreeCompany,
ChatType.Linkshell1,
ChatType.Linkshell2,
ChatType.Linkshell3,
ChatType.Linkshell4,
ChatType.Linkshell5,
ChatType.Linkshell6,
ChatType.Linkshell7,
ChatType.Linkshell8,
ChatType.CrossLinkshell1,
ChatType.CrossLinkshell2,
ChatType.CrossLinkshell3,
ChatType.CrossLinkshell4,
ChatType.CrossLinkshell5,
ChatType.CrossLinkshell6,
ChatType.CrossLinkshell7,
ChatType.CrossLinkshell8,
ChatType.ExtraChatLinkshell1,
ChatType.ExtraChatLinkshell2,
ChatType.ExtraChatLinkshell3,
ChatType.ExtraChatLinkshell4,
ChatType.ExtraChatLinkshell5,
ChatType.ExtraChatLinkshell6,
ChatType.ExtraChatLinkshell7,
ChatType.ExtraChatLinkshell8,
};
// Per-channel retention in days. Unlisted channels fall back to
// Configuration.RetentionDefaultDays. Tells: 365, everything else: 90.
internal static readonly IReadOnlyDictionary<ChatType, int> DefaultRetentionDays =
new Dictionary<ChatType, int>
{
[ChatType.TellIncoming] = 365,
[ChatType.TellOutgoing] = 365,
[ChatType.Party] = 90,
[ChatType.CrossParty] = 90,
[ChatType.Alliance] = 90,
[ChatType.PvpTeam] = 90,
[ChatType.FreeCompany] = 90,
[ChatType.Linkshell1] = 90,
[ChatType.Linkshell2] = 90,
[ChatType.Linkshell3] = 90,
[ChatType.Linkshell4] = 90,
[ChatType.Linkshell5] = 90,
[ChatType.Linkshell6] = 90,
[ChatType.Linkshell7] = 90,
[ChatType.Linkshell8] = 90,
[ChatType.CrossLinkshell1] = 90,
[ChatType.CrossLinkshell2] = 90,
[ChatType.CrossLinkshell3] = 90,
[ChatType.CrossLinkshell4] = 90,
[ChatType.CrossLinkshell5] = 90,
[ChatType.CrossLinkshell6] = 90,
[ChatType.CrossLinkshell7] = 90,
[ChatType.CrossLinkshell8] = 90,
[ChatType.ExtraChatLinkshell1] = 90,
[ChatType.ExtraChatLinkshell2] = 90,
[ChatType.ExtraChatLinkshell3] = 90,
[ChatType.ExtraChatLinkshell4] = 90,
[ChatType.ExtraChatLinkshell5] = 90,
[ChatType.ExtraChatLinkshell6] = 90,
[ChatType.ExtraChatLinkshell7] = 90,
[ChatType.ExtraChatLinkshell8] = 90,
};
// Casual: Privacy-First + public chat (Say/Shout/Yell, emotes, Novice
// Network) with a 1-day window so recent RP/trade is searchable but
// third-party data doesn't accumulate.
internal static readonly IReadOnlySet<ChatType> CasualWhitelist = new HashSet<ChatType>(
PrivacyFirstWhitelist
)
{
ChatType.Say,
ChatType.Shout,
ChatType.Yell,
ChatType.CustomEmote,
ChatType.StandardEmote,
ChatType.NoviceNetwork,
};
internal static readonly IReadOnlyDictionary<ChatType, int> CasualRetentionOverrides =
new Dictionary<ChatType, int>
{
[ChatType.Say] = 1,
[ChatType.Shout] = 1,
[ChatType.Yell] = 1,
[ChatType.CustomEmote] = 1,
[ChatType.StandardEmote] = 1,
[ChatType.NoviceNetwork] = 1,
};
}