mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
16 lines
456 B
TypeScript
16 lines
456 B
TypeScript
// Copyright 2025 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import { DurationInSeconds } from './durations/duration-in-seconds.std.js';
|
|
|
|
export function getPinnedMessageExpiresAt(
|
|
receivedAtTimestamp: number,
|
|
pinDuration: DurationInSeconds | null
|
|
): number | null {
|
|
if (pinDuration == null) {
|
|
return null;
|
|
}
|
|
const pinDurationMs = DurationInSeconds.toMillis(pinDuration);
|
|
return receivedAtTimestamp + pinDurationMs;
|
|
}
|