Admin Delete

This commit is contained in:
Jamie
2026-02-27 11:55:02 -08:00
committed by Yash
parent b71b5570d3
commit e424610cc2
67 changed files with 2328 additions and 569 deletions

View File

@@ -0,0 +1,26 @@
// Copyright 2026 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { getValue } from '../RemoteConfig.dom.js';
import { safeParseInteger } from './numbers.std.js';
import { DAY, SECOND } from './durations/index.std.js';
const DEFAULT_DELETE_MAX_AGE_MS = DAY;
function parseMaxAgeSecsToMs(configValue: string | undefined) {
if (configValue != null) {
const parsed = safeParseInteger(configValue);
if (parsed != null && parsed > 0) {
return parsed * SECOND;
}
}
return DEFAULT_DELETE_MAX_AGE_MS;
}
export function getNormalDeleteMaxAgeMs(): number {
return parseMaxAgeSecsToMs(getValue('global.normalDeleteMaxAgeInSeconds'));
}
export function getAdminDeleteMaxAgeMs(): number {
return parseMaxAgeSecsToMs(getValue('global.adminDeleteMaxAgeInSeconds'));
}