2019-04-30 12:24:12 +02:00
|
|
|
import { NativeModules } from 'react-native';
|
|
|
|
|
|
2022-10-20 12:11:27 +03:00
|
|
|
import { IReduxState } from '../../app/types';
|
2022-09-14 10:54:56 +03:00
|
|
|
import { REPLACE_PARTICIPANT } from '../flags/constants';
|
|
|
|
|
import { getFeatureFlag } from '../flags/functions';
|
|
|
|
|
|
2022-12-20 19:03:57 +02:00
|
|
|
import { IConfig, IDeeplinkingConfig } from './configType';
|
2021-06-16 14:08:18 +03:00
|
|
|
|
2019-04-30 12:24:12 +02:00
|
|
|
export * from './functions.any';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Removes all analytics related options from the given configuration, in case of a libre build.
|
|
|
|
|
*
|
|
|
|
|
* @param {*} config - The configuration which needs to be cleaned up.
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
2022-09-14 10:54:56 +03:00
|
|
|
export function _cleanupConfig(config: IConfig) {
|
2022-12-15 18:00:22 +02:00
|
|
|
config.analytics = config.analytics ?? {};
|
2019-10-11 11:46:57 +02:00
|
|
|
config.analytics.scriptURLs = [];
|
2022-12-15 18:00:22 +02:00
|
|
|
|
2019-04-30 12:24:12 +02:00
|
|
|
if (NativeModules.AppInfo.LIBRE_BUILD) {
|
2021-08-17 12:24:18 -05:00
|
|
|
delete config.analytics?.amplitudeAPPKey;
|
2022-12-15 18:00:22 +02:00
|
|
|
delete config.analytics?.rtcstatsEnabled;
|
|
|
|
|
delete config.analytics?.rtcstatsEndpoint;
|
|
|
|
|
delete config.analytics?.rtcstatsPollInterval;
|
|
|
|
|
delete config.analytics?.rtcstatsSendSdp;
|
|
|
|
|
delete config.analytics?.rtcstatsUseLegacy;
|
|
|
|
|
delete config.analytics?.obfuscateRoomName;
|
2023-07-20 12:10:48 +05:30
|
|
|
delete config.analytics?.watchRTCEnabled;
|
|
|
|
|
delete config.watchRTCConfigParams;
|
2022-07-21 12:21:27 +02:00
|
|
|
config.giphy = { enabled: false };
|
2019-04-30 12:24:12 +02:00
|
|
|
}
|
|
|
|
|
}
|
2021-06-16 14:08:18 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the replaceParticipant config.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} state - The state of the app.
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
2022-10-20 12:11:27 +03:00
|
|
|
export function getReplaceParticipant(state: IReduxState): string {
|
2021-06-16 14:08:18 +03:00
|
|
|
return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
|
|
|
|
|
}
|
2022-12-20 19:03:57 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets the defaults for deeplinking.
|
|
|
|
|
*
|
|
|
|
|
* @param {IDeeplinkingConfig} _deeplinking - The deeplinking config.
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
export function _setDeeplinkingDefaults(_deeplinking: IDeeplinkingConfig) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|