Plumb through new ADM setting.
Co-authored-by: ayumi-signal <ayumi@signal.org>
This commit is contained in:
parent
fc7eba772c
commit
c8a729f8be
5 changed files with 47 additions and 0 deletions
|
@ -18,6 +18,7 @@ export type ConfigKeyType =
|
||||||
| 'desktop.calling.adhoc'
|
| 'desktop.calling.adhoc'
|
||||||
| 'desktop.calling.adhoc.create'
|
| 'desktop.calling.adhoc.create'
|
||||||
| 'desktop.calling.raiseHand'
|
| 'desktop.calling.raiseHand'
|
||||||
|
| 'desktop.calling.ringrtcAdm'
|
||||||
| 'desktop.clientExpiration'
|
| 'desktop.clientExpiration'
|
||||||
| 'desktop.backup.credentialFetch'
|
| 'desktop.backup.credentialFetch'
|
||||||
| 'desktop.internalUser'
|
| 'desktop.internalUser'
|
||||||
|
|
|
@ -155,6 +155,7 @@ import { getConversationIdForLogging } from '../util/idForLogging';
|
||||||
import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync';
|
import { sendCallLinkUpdateSync } from '../util/sendCallLinkUpdateSync';
|
||||||
import { createIdenticon } from '../util/createIdenticon';
|
import { createIdenticon } from '../util/createIdenticon';
|
||||||
import { getColorForCallLink } from '../util/getColorForCallLink';
|
import { getColorForCallLink } from '../util/getColorForCallLink';
|
||||||
|
import { getUseRingrtcAdm } from '../util/ringrtc/ringrtcAdm';
|
||||||
|
|
||||||
const { wasGroupCallRingPreviouslyCanceled } = DataReader;
|
const { wasGroupCallRingPreviouslyCanceled } = DataReader;
|
||||||
const {
|
const {
|
||||||
|
@ -378,6 +379,7 @@ export class CallingClass {
|
||||||
|
|
||||||
RingRTC.setConfig({
|
RingRTC.setConfig({
|
||||||
field_trials: undefined,
|
field_trials: undefined,
|
||||||
|
use_ringrtc_adm: getUseRingrtcAdm(),
|
||||||
});
|
});
|
||||||
|
|
||||||
RingRTC.handleOutgoingSignaling = this.handleOutgoingSignaling.bind(this);
|
RingRTC.handleOutgoingSignaling = this.handleOutgoingSignaling.bind(this);
|
||||||
|
|
1
ts/types/Storage.d.ts
vendored
1
ts/types/Storage.d.ts
vendored
|
@ -110,6 +110,7 @@ export type StorageAccessType = {
|
||||||
synced_at: number;
|
synced_at: number;
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
uuid_id: string;
|
uuid_id: string;
|
||||||
|
useRingrtcAdm: boolean;
|
||||||
pni: string;
|
pni: string;
|
||||||
version: string;
|
version: string;
|
||||||
linkPreviews: boolean;
|
linkPreviews: boolean;
|
||||||
|
|
31
ts/util/ringrtc/ringrtcAdm.ts
Normal file
31
ts/util/ringrtc/ringrtcAdm.ts
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
// Copyright 2024 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
import * as RemoteConfig from '../../RemoteConfig';
|
||||||
|
import OS from '../os/osMain';
|
||||||
|
import { isProduction } from '../version';
|
||||||
|
|
||||||
|
export function getUseRingrtcAdm(): boolean {
|
||||||
|
const localUseRingrtcAdm = window.storage.get('useRingrtcAdm');
|
||||||
|
if (localUseRingrtcAdm !== undefined) {
|
||||||
|
return localUseRingrtcAdm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
isProduction(window.getVersion()) ||
|
||||||
|
OS.isLinux() ||
|
||||||
|
!RemoteConfig.isEnabled('desktop.internalUser')
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return RemoteConfig.isEnabled('desktop.calling.ringrtcAdm');
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function setUseRingrtcAdm(value: boolean): Promise<void> {
|
||||||
|
await window.storage.put('useRingrtcAdm', value);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function removeUseRingrtcAdm(): Promise<void> {
|
||||||
|
await window.storage.remove('useRingrtcAdm');
|
||||||
|
}
|
|
@ -24,6 +24,10 @@ import { initMessageCleanup } from '../../services/messageStateCleanup';
|
||||||
import { Environment, getEnvironment } from '../../environment';
|
import { Environment, getEnvironment } from '../../environment';
|
||||||
import { isProduction } from '../../util/version';
|
import { isProduction } from '../../util/version';
|
||||||
import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen';
|
import { benchmarkConversationOpen } from '../../CI/benchmarkConversationOpen';
|
||||||
|
import {
|
||||||
|
removeUseRingrtcAdm,
|
||||||
|
setUseRingrtcAdm,
|
||||||
|
} from '../../util/ringrtc/ringrtcAdm';
|
||||||
|
|
||||||
window.addEventListener('contextmenu', e => {
|
window.addEventListener('contextmenu', e => {
|
||||||
const node = e.target as Element | null;
|
const node = e.target as Element | null;
|
||||||
|
@ -74,6 +78,10 @@ if (
|
||||||
name: K,
|
name: K,
|
||||||
value: StorageAccessType[K]
|
value: StorageAccessType[K]
|
||||||
) => window.storage.put(name, value),
|
) => window.storage.put(name, value),
|
||||||
|
removeUseRingrtcAdm: async () => {
|
||||||
|
await removeUseRingrtcAdm();
|
||||||
|
log.info('Restart to make ADM change take effect!');
|
||||||
|
},
|
||||||
setFlag: (name: keyof FeatureFlagType, value: boolean) => {
|
setFlag: (name: keyof FeatureFlagType, value: boolean) => {
|
||||||
if (!has(window.Flags, name)) {
|
if (!has(window.Flags, name)) {
|
||||||
return;
|
return;
|
||||||
|
@ -83,6 +91,10 @@ if (
|
||||||
setSfuUrl: (url: string) => {
|
setSfuUrl: (url: string) => {
|
||||||
window.Signal.Services.calling._sfuUrl = url;
|
window.Signal.Services.calling._sfuUrl = url;
|
||||||
},
|
},
|
||||||
|
setUseRingrtcAdm: async (value: boolean) => {
|
||||||
|
await setUseRingrtcAdm(value);
|
||||||
|
log.info('Restart to make ADM change take effect!');
|
||||||
|
},
|
||||||
setIceServerOverride: (
|
setIceServerOverride: (
|
||||||
override: GetIceServersResultType | string | undefined
|
override: GetIceServersResultType | string | undefined
|
||||||
) => {
|
) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue