Removes old feature flags

This commit is contained in:
Josh Perez 2021-08-18 21:04:38 -04:00 committed by GitHub
parent 778c8b4220
commit aecb11247f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 80 additions and 100 deletions

View File

@ -369,7 +369,6 @@ try {
}, 1000); }, 1000);
const { imageToBlurHash } = require('./ts/util/imageToBlurHash'); const { imageToBlurHash } = require('./ts/util/imageToBlurHash');
const { isGroupCallingEnabled } = require('./ts/util/isGroupCallingEnabled');
const { isValidGuid } = require('./ts/util/isValidGuid'); const { isValidGuid } = require('./ts/util/isValidGuid');
const { ActiveWindowService } = require('./ts/services/ActiveWindowService'); const { ActiveWindowService } = require('./ts/services/ActiveWindowService');
@ -379,7 +378,6 @@ try {
window.libphonenumber.PhoneNumberFormat = require('google-libphonenumber').PhoneNumberFormat; window.libphonenumber.PhoneNumberFormat = require('google-libphonenumber').PhoneNumberFormat;
window.loadImage = require('blueimp-load-image'); window.loadImage = require('blueimp-load-image');
window.getGuid = require('uuid/v4'); window.getGuid = require('uuid/v4');
window.isGroupCallingEnabled = isGroupCallingEnabled;
const activeWindowService = new ActiveWindowService(); const activeWindowService = new ActiveWindowService();
activeWindowService.initialize(window.document, ipc); activeWindowService.initialize(window.document, ipc);

View File

@ -3298,11 +3298,9 @@ export async function startApp(): Promise<void> {
): boolean { ): boolean {
if (message.groupCallUpdate) { if (message.groupCallUpdate) {
if (message.groupV2 && messageDescriptor.type === Message.GROUP) { if (message.groupV2 && messageDescriptor.type === Message.GROUP) {
if (window.isGroupCallingEnabled()) { window.reduxActions.calling.peekNotConnectedGroupCall({
window.reduxActions.calling.peekNotConnectedGroupCall({ conversationId: messageDescriptor.id,
conversationId: messageDescriptor.id, });
});
}
return true; return true;
} }
window.log.warn( window.log.warn(

View File

@ -30,7 +30,6 @@ import { DirectCallRemoteParticipant } from './DirectCallRemoteParticipant';
import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants'; import { GroupCallRemoteParticipants } from './GroupCallRemoteParticipants';
import { LocalizerType } from '../types/Util'; import { LocalizerType } from '../types/Util';
import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal'; import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPermissionsModal';
import { isScreenSharingEnabled } from '../util/isScreenSharingEnabled';
import { missingCaseError } from '../util/missingCaseError'; import { missingCaseError } from '../util/missingCaseError';
import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting'; import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting';
@ -372,13 +371,11 @@ export const CallScreen: React.FC<PropsType> = ({
controlsFadeClass controlsFadeClass
)} )}
> >
{isScreenSharingEnabled() ? ( <CallingButton
<CallingButton buttonType={presentingButtonType}
buttonType={presentingButtonType} i18n={i18n}
i18n={i18n} onClick={togglePresenting}
onClick={togglePresenting} />
/>
) : null}
<CallingButton <CallingButton
buttonType={videoButtonType} buttonType={videoButtonType}
i18n={i18n} i18n={i18n}

View File

@ -120,6 +120,7 @@ const createProps = (): PropsType => ({
isAutoLaunchSupported: true, isAutoLaunchSupported: true,
isHideMenuBarSupported: true, isHideMenuBarSupported: true,
isNotificationAttentionSupported: true, isNotificationAttentionSupported: true,
isPhoneNumberSharingSupported: false,
isSyncSupported: true, isSyncSupported: true,
isSystemTraySupported: true, isSystemTraySupported: true,

View File

@ -98,6 +98,7 @@ export type PropsType = {
isAutoLaunchSupported: boolean; isAutoLaunchSupported: boolean;
isHideMenuBarSupported: boolean; isHideMenuBarSupported: boolean;
isNotificationAttentionSupported: boolean; isNotificationAttentionSupported: boolean;
isPhoneNumberSharingSupported: boolean;
isSyncSupported: boolean; isSyncSupported: boolean;
isSystemTraySupported: boolean; isSystemTraySupported: boolean;
@ -182,6 +183,7 @@ export const Preferences = ({
isAudioNotificationsSupported, isAudioNotificationsSupported,
isAutoLaunchSupported, isAutoLaunchSupported,
isHideMenuBarSupported, isHideMenuBarSupported,
isPhoneNumberSharingSupported,
isNotificationAttentionSupported, isNotificationAttentionSupported,
isSyncSupported, isSyncSupported,
isSystemTraySupported, isSystemTraySupported,
@ -748,57 +750,59 @@ export const Preferences = ({
} }
/> />
</SettingsRow> </SettingsRow>
<SettingsRow title={i18n('Preferences__who-can--title')}> {isPhoneNumberSharingSupported ? (
<Control <SettingsRow title={i18n('Preferences__who-can--title')}>
left={i18n('Preferences--see-me')} <Control
right={ left={i18n('Preferences--see-me')}
<Select right={
disabled <Select
onChange={noop} disabled
options={[ onChange={noop}
{ options={[
text: i18n('Preferences__who-can--everybody'), {
value: PhoneNumberSharingMode.Everybody, text: i18n('Preferences__who-can--everybody'),
}, value: PhoneNumberSharingMode.Everybody,
{ },
text: i18n('Preferences__who-can--contacts'), {
value: PhoneNumberSharingMode.ContactsOnly, text: i18n('Preferences__who-can--contacts'),
}, value: PhoneNumberSharingMode.ContactsOnly,
{ },
text: i18n('Preferences__who-can--nobody'), {
value: PhoneNumberSharingMode.Nobody, text: i18n('Preferences__who-can--nobody'),
}, value: PhoneNumberSharingMode.Nobody,
]} },
value={whoCanSeeMe} ]}
/> value={whoCanSeeMe}
} />
/> }
<Control />
left={i18n('Preferences--find-me')} <Control
right={ left={i18n('Preferences--find-me')}
<Select right={
disabled <Select
onChange={noop} disabled
options={[ onChange={noop}
{ options={[
text: i18n('Preferences__who-can--everybody'), {
value: PhoneNumberDiscoverability.Discoverable, text: i18n('Preferences__who-can--everybody'),
}, value: PhoneNumberDiscoverability.Discoverable,
{ },
text: i18n('Preferences__who-can--nobody'), {
value: PhoneNumberDiscoverability.NotDiscoverable, text: i18n('Preferences__who-can--nobody'),
}, value: PhoneNumberDiscoverability.NotDiscoverable,
]} },
value={whoCanFindMe} ]}
/> value={whoCanFindMe}
} />
/> }
<div className="Preferences__padding"> />
<div className="Preferences__description"> <div className="Preferences__padding">
{i18n('Preferences__privacy--description')} <div className="Preferences__description">
{i18n('Preferences__privacy--description')}
</div>
</div> </div>
</div> </SettingsRow>
</SettingsRow> ) : null}
<SettingsRow title={i18n('Preferences--messaging')}> <SettingsRow title={i18n('Preferences--messaging')}>
<Checkbox <Checkbox
checked={hasReadReceipts} checked={hasReadReceipts}

View File

@ -38,6 +38,7 @@ export class SettingsChannel {
this.installCallback('getAvailableIODevices'); this.installCallback('getAvailableIODevices');
this.installCallback('isPrimary'); this.installCallback('isPrimary');
this.installCallback('syncRequest'); this.installCallback('syncRequest');
this.installCallback('isPhoneNumberSharingEnabled');
// Getters only. These are set by the primary device // Getters only. These are set by the primary device
this.installSetting('blockedCount', { setter: false }); this.installSetting('blockedCount', { setter: false });

View File

@ -22,7 +22,6 @@ import { getUserUuid, getIntl } from '../selectors/user';
import { getOwn } from '../../util/getOwn'; import { getOwn } from '../../util/getOwn';
import { missingCaseError } from '../../util/missingCaseError'; import { missingCaseError } from '../../util/missingCaseError';
import { isConversationSMSOnly } from '../../util/isConversationSMSOnly'; import { isConversationSMSOnly } from '../../util/isConversationSMSOnly';
import { isGroupCallingEnabled } from '../../util/isGroupCallingEnabled';
export type OwnProps = { export type OwnProps = {
id: string; id: string;
@ -65,9 +64,6 @@ const getOutgoingCallButtonStyle = (
case CallMode.Direct: case CallMode.Direct:
return OutgoingCallButtonStyle.Both; return OutgoingCallButtonStyle.Both;
case CallMode.Group: { case CallMode.Group: {
if (!isGroupCallingEnabled()) {
return OutgoingCallButtonStyle.None;
}
const call = getOwn(calling.callsByConversation, conversation.id); const call = getOwn(calling.callsByConversation, conversation.id);
if ( if (
call?.callMode === CallMode.Group && call?.callMode === CallMode.Group &&

View File

@ -27,6 +27,7 @@ import * as universalExpireTimer from './universalExpireTimer';
import { PhoneNumberDiscoverability } from './phoneNumberDiscoverability'; import { PhoneNumberDiscoverability } from './phoneNumberDiscoverability';
import { PhoneNumberSharingMode } from './phoneNumberSharingMode'; import { PhoneNumberSharingMode } from './phoneNumberSharingMode';
import { assert } from './assert'; import { assert } from './assert';
import { isPhoneNumberSharingEnabled } from './isPhoneNumberSharingEnabled';
type ThemeType = 'light' | 'dark' | 'system'; type ThemeType = 'light' | 'dark' | 'system';
type NotificationSettingType = 'message' | 'name' | 'count' | 'off'; type NotificationSettingType = 'message' | 'name' | 'count' | 'off';
@ -81,6 +82,7 @@ export type IPCEventsCallbacksType = {
editCustomColor: (colorId: string, customColor: CustomColorType) => void; editCustomColor: (colorId: string, customColor: CustomColorType) => void;
getConversationsWithCustomColor: (x: string) => Array<ConversationType>; getConversationsWithCustomColor: (x: string) => Array<ConversationType>;
installStickerPack: (packId: string, key: string) => Promise<void>; installStickerPack: (packId: string, key: string) => Promise<void>;
isPhoneNumberSharingEnabled: () => boolean;
isPrimary: () => boolean; isPrimary: () => boolean;
removeCustomColor: (x: string) => void; removeCustomColor: (x: string) => void;
removeCustomColorOnConversations: (x: string) => void; removeCustomColorOnConversations: (x: string) => void;
@ -321,6 +323,7 @@ export function createIPCEvents(
window.setAutoLaunch(value); window.setAutoLaunch(value);
}, },
isPhoneNumberSharingEnabled: () => isPhoneNumberSharingEnabled(),
isPrimary: () => window.textsecure.storage.user.getDeviceId() === 1, isPrimary: () => window.textsecure.storage.user.getDeviceId() === 1,
syncRequest: () => syncRequest: () =>
new Promise<void>((resolve, reject) => { new Promise<void>((resolve, reject) => {

View File

@ -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())
);
}

View 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'));
}

View File

@ -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
View File

@ -511,7 +511,6 @@ declare global {
isShowingModal?: boolean; isShowingModal?: boolean;
// Feature Flags // Feature Flags
isGroupCallingEnabled: () => boolean;
GV2_ENABLE_SINGLE_CHANGE_PROCESSING: boolean; GV2_ENABLE_SINGLE_CHANGE_PROCESSING: boolean;
GV2_ENABLE_CHANGE_PROCESSING: boolean; GV2_ENABLE_CHANGE_PROCESSING: boolean;
GV2_ENABLE_STATE_PROCESSING: boolean; GV2_ENABLE_STATE_PROCESSING: boolean;

View File

@ -46,6 +46,7 @@ installSetting('callSystemNotification');
installSetting('deviceName'); installSetting('deviceName');
installSetting('hideMenuBar'); installSetting('hideMenuBar');
installSetting('incomingCallNotification'); installSetting('incomingCallNotification');
installCallback('isPhoneNumberSharingEnabled');
installCallback('isPrimary'); installCallback('isPrimary');
installCallback('syncRequest'); installCallback('syncRequest');
installSetting('notificationDrawAttention'); installSetting('notificationDrawAttention');

View File

@ -102,6 +102,7 @@ const ipcGetAvailableIODevices = createCallback('getAvailableIODevices');
const ipcGetCustomColors = createCallback('getCustomColors'); const ipcGetCustomColors = createCallback('getCustomColors');
const ipcIsSyncNotSupported = createCallback('isPrimary'); const ipcIsSyncNotSupported = createCallback('isPrimary');
const ipcMakeSyncRequest = createCallback('syncRequest'); const ipcMakeSyncRequest = createCallback('syncRequest');
const ipcPNP = createCallback('isPhoneNumberSharingEnabled');
// ChatColorPicker redux hookups // ChatColorPicker redux hookups
// The redux actions update over IPC through a preferences re-render // The redux actions update over IPC through a preferences re-render
@ -179,6 +180,7 @@ async function renderPreferences() {
hasRelayCalls, hasRelayCalls,
hasSpellCheck, hasSpellCheck,
hasTypingIndicators, hasTypingIndicators,
isPhoneNumberSharingSupported,
lastSyncTime, lastSyncTime,
notificationContent, notificationContent,
selectedCamera, selectedCamera,
@ -213,6 +215,7 @@ async function renderPreferences() {
hasRelayCalls: settingRelayCalls.getValue(), hasRelayCalls: settingRelayCalls.getValue(),
hasSpellCheck: settingSpellCheck.getValue(), hasSpellCheck: settingSpellCheck.getValue(),
hasTypingIndicators: settingTypingIndicators.getValue(), hasTypingIndicators: settingTypingIndicators.getValue(),
isPhoneNumberSharingSupported: ipcPNP(),
lastSyncTime: settingLastSyncTime.getValue(), lastSyncTime: settingLastSyncTime.getValue(),
notificationContent: settingNotificationSetting.getValue(), notificationContent: settingNotificationSetting.getValue(),
selectedCamera: settingVideoInput.getValue(), selectedCamera: settingVideoInput.getValue(),
@ -301,6 +304,7 @@ async function renderPreferences() {
isAutoLaunchSupported: Settings.isAutoLaunchSupported(), isAutoLaunchSupported: Settings.isAutoLaunchSupported(),
isHideMenuBarSupported: Settings.isHideMenuBarSupported(), isHideMenuBarSupported: Settings.isHideMenuBarSupported(),
isNotificationAttentionSupported: Settings.isDrawAttentionSupported(), isNotificationAttentionSupported: Settings.isDrawAttentionSupported(),
isPhoneNumberSharingSupported,
isSyncSupported: !isSyncNotSupported, isSyncSupported: !isSyncNotSupported,
isSystemTraySupported: Settings.isSystemTraySupported(window.getVersion()), isSystemTraySupported: Settings.isSystemTraySupported(window.getVersion()),