Fall back to spec retention defaults before the global default

GetRetentionDays previously dropped straight from a missing user
override to RetentionDefaultDays, so every channel showed 30 days
in the UI even though the spec lists 365 for Tells and 90 for own-
conversation channels. Insert a middle layer: user override → spec
default → global default. The retention sweep now seeds its policy
from PrivacyDefaults.DefaultRetentionDays first and lets explicit
user overrides win on top, and the per-channel UI tags each row as
[override], [spec], or [global] so the source of the value is
visible without guessing.
This commit is contained in:
2026-05-01 18:52:54 +02:00
parent 68c7185cea
commit 353596fa43
3 changed files with 16 additions and 3 deletions
+6 -1
View File
@@ -318,7 +318,12 @@ public sealed class Plugin : IDalamudPlugin
return;
// Snapshot the policy so the user can edit settings while we run.
var policy = Config.RetentionPerChannelDays.ToDictionary(p => (int)(ushort)p.Key, p => p.Value);
// Spec defaults form the baseline; explicit user overrides win.
var policy = new Dictionary<int, int>();
foreach (var (type, days) in Privacy.PrivacyDefaults.DefaultRetentionDays)
policy[(int)(ushort)type] = days;
foreach (var (type, days) in Config.RetentionPerChannelDays)
policy[(int)(ushort)type] = days;
var defaultDays = Config.RetentionDefaultDays;
new Thread(() =>