You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.native.ts 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { NativeModules } from 'react-native';
  2. import { IReduxState } from '../../app/types';
  3. import { REPLACE_PARTICIPANT } from '../flags/constants';
  4. import { getFeatureFlag } from '../flags/functions';
  5. import { IConfig, IDeeplinkingConfig } from './configType';
  6. export * from './functions.any';
  7. /**
  8. * Removes all analytics related options from the given configuration, in case of a libre build.
  9. *
  10. * @param {*} config - The configuration which needs to be cleaned up.
  11. * @returns {void}
  12. */
  13. export function _cleanupConfig(config: IConfig) {
  14. config.analytics = config.analytics ?? {};
  15. config.analytics.scriptURLs = [];
  16. if (NativeModules.AppInfo.LIBRE_BUILD) {
  17. delete config.analytics?.amplitudeAPPKey;
  18. delete config.analytics?.rtcstatsEnabled;
  19. delete config.analytics?.rtcstatsEndpoint;
  20. delete config.analytics?.rtcstatsPollInterval;
  21. delete config.analytics?.rtcstatsSendSdp;
  22. delete config.analytics?.rtcstatsUseLegacy;
  23. delete config.analytics?.obfuscateRoomName;
  24. delete config.analytics?.watchRTCEnabled;
  25. delete config.watchRTCConfigParams;
  26. config.giphy = { enabled: false };
  27. }
  28. }
  29. /**
  30. * Returns the replaceParticipant config.
  31. *
  32. * @param {Object} state - The state of the app.
  33. * @returns {boolean}
  34. */
  35. export function getReplaceParticipant(state: IReduxState): string {
  36. return getFeatureFlag(state, REPLACE_PARTICIPANT, false);
  37. }
  38. /**
  39. * Sets the defaults for deeplinking.
  40. *
  41. * @param {IDeeplinkingConfig} _deeplinking - The deeplinking config.
  42. * @returns {void}
  43. */
  44. export function _setDeeplinkingDefaults(_deeplinking: IDeeplinkingConfig) {
  45. return;
  46. }