From 7eb50e2c8d616ed5c421e4c579dbaa24f846143d Mon Sep 17 00:00:00 2001 From: Jon Kazama Date: Tue, 12 May 2026 09:54:05 +0200 Subject: [PATCH] feat(privacy): log warning on unknown ChatType in IsAllowedForStorage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit F3.2: a future FFXIV patch can introduce ChatTypes that aren't on any existing whitelist, and the filter currently routes them silently through the unknown-channel failsafe. Add a dedup HashSet (per runtime, NonSerialized) so the first hit per ChatType logs a Warning. The failsafe behaviour itself is unchanged — only visibility is new. --- HellionChat/Configuration.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/HellionChat/Configuration.cs b/HellionChat/Configuration.cs index d8bfd55..920caa3 100755 --- a/HellionChat/Configuration.cs +++ b/HellionChat/Configuration.cs @@ -64,12 +64,30 @@ public class Configuration : IPluginConfiguration .PrivacyDefaults .DefaultPersistUnknownChannels; + // F3.2: dedup unknown-ChatType warnings so a chatty filter doesn't spam + // the log every frame. NonSerialized so the warning fires once per + // runtime, not once-ever-per-install. + [NonSerialized] + private readonly HashSet _warnedUnknownChannels = new(); + public bool IsAllowedForStorage(ChatType type) { if (!PrivacyFilterEnabled) return true; if (PrivacyPersistChannels.Contains(type)) return true; + + // F3.2: log first occurrence so a new patch's ChatType doesn't drop + // off the radar. Failsafe still applies via PrivacyPersistUnknownChannels. + if (_warnedUnknownChannels.Add(type)) + { + Plugin.Log.Warning( + "PrivacyFilter: unknown ChatType {Type} — falling back to PrivacyPersistUnknownChannels={Persist}.", + type, + PrivacyPersistUnknownChannels + ); + } + return PrivacyPersistUnknownChannels; }