2024-10-18 17:15:03 +00:00
|
|
|
// Copyright 2024 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { isTestOrMockEnvironment } from '../environment';
|
|
|
|
import { isStagingServer } from './isStagingServer';
|
2024-12-12 17:42:40 +00:00
|
|
|
import { isAdhoc, isNightly } from './version';
|
2024-10-18 17:15:03 +00:00
|
|
|
import { everDone as wasRegistrationEverDone } from './registration';
|
|
|
|
|
2024-10-22 18:49:44 +00:00
|
|
|
export function isLinkAndSyncEnabled(version: string): boolean {
|
2024-10-18 17:15:03 +00:00
|
|
|
// Cannot overwrite existing message history
|
|
|
|
if (wasRegistrationEverDone()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2024-12-12 17:42:40 +00:00
|
|
|
return (
|
|
|
|
isStagingServer() ||
|
|
|
|
isTestOrMockEnvironment() ||
|
|
|
|
isNightly(version) ||
|
|
|
|
isAdhoc(version)
|
|
|
|
);
|
2024-10-18 17:15:03 +00:00
|
|
|
}
|