Removes old feature flags
This commit is contained in:
parent
778c8b4220
commit
aecb11247f
14 changed files with 80 additions and 100 deletions
|
@ -369,7 +369,6 @@ try {
|
|||
}, 1000);
|
||||
|
||||
const { imageToBlurHash } = require('./ts/util/imageToBlurHash');
|
||||
const { isGroupCallingEnabled } = require('./ts/util/isGroupCallingEnabled');
|
||||
const { isValidGuid } = require('./ts/util/isValidGuid');
|
||||
const { ActiveWindowService } = require('./ts/services/ActiveWindowService');
|
||||
|
||||
|
@ -379,7 +378,6 @@ try {
|
|||
window.libphonenumber.PhoneNumberFormat = require('google-libphonenumber').PhoneNumberFormat;
|
||||
window.loadImage = require('blueimp-load-image');
|
||||
window.getGuid = require('uuid/v4');
|
||||
window.isGroupCallingEnabled = isGroupCallingEnabled;
|
||||
|
||||
const activeWindowService = new ActiveWindowService();
|
||||
activeWindowService.initialize(window.document, ipc);
|
||||
|
|
|
@ -3298,11 +3298,9 @@ export async function startApp(): Promise<void> {
|
|||
): boolean {
|
||||
if (message.groupCallUpdate) {
|
||||
if (message.groupV2 && messageDescriptor.type === Message.GROUP) {
|
||||
if (window.isGroupCallingEnabled()) {
|
||||
window.reduxActions.calling.peekNotConnectedGroupCall({
|
||||
conversationId: messageDescriptor.id,
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
window.log.warn(
|
||||
|
|
|
@ -30,7 +30,6 @@ import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
|
|||
import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants';
|
||||
import { LocalizerType } from '../types/Util';
|
||||
import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal';
|
||||
import { isScreenSharingEnabled } from '../util/isScreenSharingEnabled';
|
||||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting';
|
||||
|
||||
|
@ -372,13 +371,11 @@ export const CallScreen: React.FC<PropsType> = ({
|
|||
controlsFadeClass
|
||||
)}
|
||||
>
|
||||
{isScreenSharingEnabled() ? (
|
||||
<CallingButton
|
||||
buttonType={presentingButtonType}
|
||||
i18n={i18n}
|
||||
onClick={togglePresenting}
|
||||
/>
|
||||
) : null}
|
||||
<CallingButton
|
||||
buttonType={videoButtonType}
|
||||
i18n={i18n}
|
||||
|
|
|
@ -120,6 +120,7 @@ const createProps = (): PropsType => ({
|
|||
isAutoLaunchSupported: true,
|
||||
isHideMenuBarSupported: true,
|
||||
isNotificationAttentionSupported: true,
|
||||
isPhoneNumberSharingSupported: false,
|
||||
isSyncSupported: true,
|
||||
isSystemTraySupported: true,
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ export type PropsType = {
|
|||
isAutoLaunchSupported: boolean;
|
||||
isHideMenuBarSupported: boolean;
|
||||
isNotificationAttentionSupported: boolean;
|
||||
isPhoneNumberSharingSupported: boolean;
|
||||
isSyncSupported: boolean;
|
||||
isSystemTraySupported: boolean;
|
||||
|
||||
|
@ -182,6 +183,7 @@ export const Preferences = ({
|
|||
isAudioNotificationsSupported,
|
||||
isAutoLaunchSupported,
|
||||
isHideMenuBarSupported,
|
||||
isPhoneNumberSharingSupported,
|
||||
isNotificationAttentionSupported,
|
||||
isSyncSupported,
|
||||
isSystemTraySupported,
|
||||
|
@ -748,6 +750,7 @@ export const Preferences = ({
|
|||
}
|
||||
/>
|
||||
</SettingsRow>
|
||||
{isPhoneNumberSharingSupported ? (
|
||||
<SettingsRow title={i18n('Preferences__who-can--title')}>
|
||||
<Control
|
||||
left={i18n('Preferences--see-me')}
|
||||
|
@ -799,6 +802,7 @@ export const Preferences = ({
|
|||
</div>
|
||||
</div>
|
||||
</SettingsRow>
|
||||
) : null}
|
||||
<SettingsRow title={i18n('Preferences--messaging')}>
|
||||
<Checkbox
|
||||
checked={hasReadReceipts}
|
||||
|
|
|
@ -38,6 +38,7 @@ export class SettingsChannel {
|
|||
this.installCallback('getAvailableIODevices');
|
||||
this.installCallback('isPrimary');
|
||||
this.installCallback('syncRequest');
|
||||
this.installCallback('isPhoneNumberSharingEnabled');
|
||||
|
||||
// Getters only. These are set by the primary device
|
||||
this.installSetting('blockedCount', { setter: false });
|
||||
|
|
|
@ -22,7 +22,6 @@ import { getUserUuid, getIntl } from '../selectors/user';
|
|||
import { getOwn } from '../../util/getOwn';
|
||||
import { missingCaseError } from '../../util/missingCaseError';
|
||||
import { isConversationSMSOnly } from '../../util/isConversationSMSOnly';
|
||||
import { isGroupCallingEnabled } from '../../util/isGroupCallingEnabled';
|
||||
|
||||
export type OwnProps = {
|
||||
id: string;
|
||||
|
@ -65,9 +64,6 @@ const getOutgoingCallButtonStyle = (
|
|||
case CallMode.Direct:
|
||||
return OutgoingCallButtonStyle.Both;
|
||||
case CallMode.Group: {
|
||||
if (!isGroupCallingEnabled()) {
|
||||
return OutgoingCallButtonStyle.None;
|
||||
}
|
||||
const call = getOwn(calling.callsByConversation, conversation.id);
|
||||
if (
|
||||
call?.callMode === CallMode.Group &&
|
||||
|
|
|
@ -27,6 +27,7 @@ import * as universalExpireTimer from './universalExpireTimer';
|
|||
import { PhoneNumberDiscoverability } from './phoneNumberDiscoverability';
|
||||
import { PhoneNumberSharingMode } from './phoneNumberSharingMode';
|
||||
import { assert } from './assert';
|
||||
import { isPhoneNumberSharingEnabled } from './isPhoneNumberSharingEnabled';
|
||||
|
||||
type ThemeType = 'light' | 'dark' | 'system';
|
||||
type NotificationSettingType = 'message' | 'name' | 'count' | 'off';
|
||||
|
@ -81,6 +82,7 @@ export type IPCEventsCallbacksType = {
|
|||
editCustomColor: (colorId: string, customColor: CustomColorType) => void;
|
||||
getConversationsWithCustomColor: (x: string) => Array<ConversationType>;
|
||||
installStickerPack: (packId: string, key: string) => Promise<void>;
|
||||
isPhoneNumberSharingEnabled: () => boolean;
|
||||
isPrimary: () => boolean;
|
||||
removeCustomColor: (x: string) => void;
|
||||
removeCustomColorOnConversations: (x: string) => void;
|
||||
|
@ -321,6 +323,7 @@ export function createIPCEvents(
|
|||
window.setAutoLaunch(value);
|
||||
},
|
||||
|
||||
isPhoneNumberSharingEnabled: () => isPhoneNumberSharingEnabled(),
|
||||
isPrimary: () => window.textsecure.storage.user.getDeviceId() === 1,
|
||||
syncRequest: () =>
|
||||
new Promise<void>((resolve, reject) => {
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { isProduction } from './version';
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
|
||||
// We can remove this function once group calling has been turned on for everyone.
|
||||
export function isGroupCallingEnabled(): boolean {
|
||||
return (
|
||||
RemoteConfig.isEnabled('desktop.groupCalling') ||
|
||||
!isProduction(window.getVersion())
|
||||
);
|
||||
}
|
8
ts/util/isPhoneNumberSharingEnabled.ts
Normal file
8
ts/util/isPhoneNumberSharingEnabled.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
|
||||
export function isPhoneNumberSharingEnabled(): boolean {
|
||||
return Boolean(RemoteConfig.isEnabled('desktop.internalUser'));
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
import { isProduction } from './version';
|
||||
|
||||
// We can remove this function once screen sharing has been turned on for everyone
|
||||
export function isScreenSharingEnabled(): boolean {
|
||||
// `window.getVersion` is missing in Storybook.
|
||||
const version = window.getVersion?.();
|
||||
|
||||
return Boolean(
|
||||
RemoteConfig.isEnabled('desktop.internalUser') ||
|
||||
RemoteConfig.isEnabled('desktop.screensharing2') ||
|
||||
(version && !isProduction(version))
|
||||
);
|
||||
}
|
1
ts/window.d.ts
vendored
1
ts/window.d.ts
vendored
|
@ -511,7 +511,6 @@ declare global {
|
|||
isShowingModal?: boolean;
|
||||
|
||||
// Feature Flags
|
||||
isGroupCallingEnabled: () => boolean;
|
||||
GV2_ENABLE_SINGLE_CHANGE_PROCESSING: boolean;
|
||||
GV2_ENABLE_CHANGE_PROCESSING: boolean;
|
||||
GV2_ENABLE_STATE_PROCESSING: boolean;
|
||||
|
|
|
@ -46,6 +46,7 @@ installSetting('callSystemNotification');
|
|||
installSetting('deviceName');
|
||||
installSetting('hideMenuBar');
|
||||
installSetting('incomingCallNotification');
|
||||
installCallback('isPhoneNumberSharingEnabled');
|
||||
installCallback('isPrimary');
|
||||
installCallback('syncRequest');
|
||||
installSetting('notificationDrawAttention');
|
||||
|
|
|
@ -102,6 +102,7 @@ const ipcGetAvailableIODevices = createCallback('getAvailableIODevices');
|
|||
const ipcGetCustomColors = createCallback('getCustomColors');
|
||||
const ipcIsSyncNotSupported = createCallback('isPrimary');
|
||||
const ipcMakeSyncRequest = createCallback('syncRequest');
|
||||
const ipcPNP = createCallback('isPhoneNumberSharingEnabled');
|
||||
|
||||
// ChatColorPicker redux hookups
|
||||
// The redux actions update over IPC through a preferences re-render
|
||||
|
@ -179,6 +180,7 @@ async function renderPreferences() {
|
|||
hasRelayCalls,
|
||||
hasSpellCheck,
|
||||
hasTypingIndicators,
|
||||
isPhoneNumberSharingSupported,
|
||||
lastSyncTime,
|
||||
notificationContent,
|
||||
selectedCamera,
|
||||
|
@ -213,6 +215,7 @@ async function renderPreferences() {
|
|||
hasRelayCalls: settingRelayCalls.getValue(),
|
||||
hasSpellCheck: settingSpellCheck.getValue(),
|
||||
hasTypingIndicators: settingTypingIndicators.getValue(),
|
||||
isPhoneNumberSharingSupported: ipcPNP(),
|
||||
lastSyncTime: settingLastSyncTime.getValue(),
|
||||
notificationContent: settingNotificationSetting.getValue(),
|
||||
selectedCamera: settingVideoInput.getValue(),
|
||||
|
@ -301,6 +304,7 @@ async function renderPreferences() {
|
|||
isAutoLaunchSupported: Settings.isAutoLaunchSupported(),
|
||||
isHideMenuBarSupported: Settings.isHideMenuBarSupported(),
|
||||
isNotificationAttentionSupported: Settings.isDrawAttentionSupported(),
|
||||
isPhoneNumberSharingSupported,
|
||||
isSyncSupported: !isSyncNotSupported,
|
||||
isSystemTraySupported: Settings.isSystemTraySupported(window.getVersion()),
|
||||
|
||||
|
|
Loading…
Reference in a new issue