fix(settings): show which channels get their history deleted
Three of the four first-run profiles switch the retention sweep on and write a per-channel deletion policy. The window only ever showed the global default, so whatever the wizard decided about individual channels was invisible from the moment the wizard closed. The tab now lists every channel whose retention differs from the global value, tagged by where the number comes from, plus a button to drop the custom ones. It also finally uses the strings written for this screen, sweep description and default help included. Read-only, deliberately. Zero means "keep forever" as a global default and "delete this channel's entire history" as a per-channel value, because the default takes a separate SQL branch while a mapped channel gets cutoff = now. No shipped profile contains a zero and no UI could set one, so nothing is broken today -- but an editor cannot be offered until those two meanings agree. Noted at the branch in DeleteByRetentionPolicy. The default slider now goes down to 0, which is the value that means "never delete anything". Its own label has been promising "0 = never" while the slider started at 1.
This commit is contained in:
@@ -529,6 +529,12 @@ internal class MessageStore : IDisposable
|
||||
var index = 0;
|
||||
foreach (var (type, days) in chatTypeDaysMap)
|
||||
{
|
||||
// Careful: 0 here is NOT the "keep forever" it means for
|
||||
// defaultDays below. A per-channel 0 puts the cutoff at now
|
||||
// and deletes the channel's entire history. No profile ships
|
||||
// a 0 and no UI can set one, which is why this is a comment
|
||||
// and not a guard -- but any editor added later has to
|
||||
// reconcile the two meanings before it exposes the value.
|
||||
var cutoff = nowMs - days * 86400000L;
|
||||
var typeParam = $"$type{index}";
|
||||
var cutoffParam = $"$cutoff{index}";
|
||||
|
||||
Reference in New Issue
Block a user