Remove desktop.calling.adhoc flags
This commit is contained in:
parent
ba80d310d2
commit
6451ff0cf1
11 changed files with 6 additions and 92 deletions
|
@ -15,10 +15,6 @@ import { HashType } from './types/Crypto';
|
|||
import { getCountryCode } from './types/PhoneNumber';
|
||||
|
||||
export type ConfigKeyType =
|
||||
| 'desktop.calling.adhoc'
|
||||
| 'desktop.calling.adhoc.beta'
|
||||
| 'desktop.calling.adhoc.create'
|
||||
| 'desktop.calling.adhoc.create.beta'
|
||||
| 'desktop.calling.ringrtcAdm'
|
||||
| 'desktop.clientExpiration'
|
||||
| 'desktop.backup.credentialFetch'
|
||||
|
|
|
@ -133,7 +133,6 @@ const defaultPendingState: SearchState = {
|
|||
|
||||
type CallsListProps = Readonly<{
|
||||
activeCall: ActiveCallStateType | undefined;
|
||||
canCreateCallLinks: boolean;
|
||||
getCallHistoryGroupsCount: (
|
||||
options: CallHistoryFilterOptions
|
||||
) => Promise<number>;
|
||||
|
@ -183,7 +182,6 @@ type Row = CallHistoryGroup | SpecialRows;
|
|||
|
||||
export function CallsList({
|
||||
activeCall,
|
||||
canCreateCallLinks,
|
||||
getCallHistoryGroupsCount,
|
||||
getCallHistoryGroups,
|
||||
callHistoryEdition,
|
||||
|
@ -232,7 +230,7 @@ export function CallsList({
|
|||
: ['EmptyState'];
|
||||
}
|
||||
|
||||
if (!searchFiltering && canCreateCallLinks) {
|
||||
if (!searchFiltering) {
|
||||
return ['CreateCallLink', ...results];
|
||||
}
|
||||
|
||||
|
@ -240,12 +238,7 @@ export function CallsList({
|
|||
return ['FilterHeader', ...results, 'ClearFilterButton'];
|
||||
}
|
||||
return results;
|
||||
}, [
|
||||
searchState.results?.items,
|
||||
searchFiltering,
|
||||
canCreateCallLinks,
|
||||
hasMissedCallFilter,
|
||||
]);
|
||||
}, [searchState.results?.items, searchFiltering, hasMissedCallFilter]);
|
||||
|
||||
const rowCount = rows.length;
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ type CallsTabProps = Readonly<{
|
|||
pagination: CallHistoryPagination
|
||||
) => Promise<Array<CallHistoryGroup>>;
|
||||
callHistoryEdition: number;
|
||||
canCreateCallLinks: boolean;
|
||||
getAdhocCall: (roomId: string) => CallStateType | undefined;
|
||||
getCall: (id: string) => CallStateType | undefined;
|
||||
getCallLink: (id: string) => CallLinkType | undefined;
|
||||
|
@ -100,7 +99,6 @@ export function CallsTab({
|
|||
getCallHistoryGroupsCount,
|
||||
getCallHistoryGroups,
|
||||
callHistoryEdition,
|
||||
canCreateCallLinks,
|
||||
getAdhocCall,
|
||||
getCall,
|
||||
getCallLink,
|
||||
|
@ -273,7 +271,6 @@ export function CallsTab({
|
|||
<CallsList
|
||||
key={CallsTabSidebarView.CallsListView}
|
||||
activeCall={activeCall}
|
||||
canCreateCallLinks={canCreateCallLinks}
|
||||
getCallHistoryGroupsCount={getCallHistoryGroupsCount}
|
||||
getCallHistoryGroups={getCallHistoryGroups}
|
||||
callHistoryEdition={callHistoryEdition}
|
||||
|
|
|
@ -145,7 +145,6 @@ import {
|
|||
callLinkRestrictionsToRingRTC,
|
||||
callLinkStateFromRingRTC,
|
||||
} from '../util/callLinksRingrtc';
|
||||
import { isAdhocCallingEnabled } from '../util/isAdhocCallingEnabled';
|
||||
import {
|
||||
conversationJobQueue,
|
||||
conversationQueueJobEnum,
|
||||
|
@ -1170,12 +1169,6 @@ export class CallingClass {
|
|||
callLinkRootKey: CallLinkRootKey;
|
||||
adminPasskey: Buffer | undefined;
|
||||
}): GroupCall {
|
||||
if (!isAdhocCallingEnabled()) {
|
||||
throw new Error(
|
||||
'Adhoc calling is not enabled; not connecting call link call'
|
||||
);
|
||||
}
|
||||
|
||||
const existing = this.#getGroupCall(roomId);
|
||||
if (existing) {
|
||||
const isExistingCallNotConnected =
|
||||
|
|
|
@ -57,7 +57,6 @@ import { callingTones } from '../../util/callingTones';
|
|||
import { requestCameraPermissions } from '../../util/callingPermissions';
|
||||
import {
|
||||
CALL_LINK_DEFAULT_STATE,
|
||||
isCallLinksCreateEnabled,
|
||||
toAdminKeyBytes,
|
||||
toCallHistoryFromUnusedCallLink,
|
||||
} from '../../util/callLinks';
|
||||
|
@ -2102,8 +2101,6 @@ function createCallLink(
|
|||
CallHistoryAdd | HandleCallLinkUpdateActionType
|
||||
> {
|
||||
return async dispatch => {
|
||||
strictAssert(isCallLinksCreateEnabled(), 'Call links creation is disabled');
|
||||
|
||||
const callLink = await calling.createCallLink();
|
||||
const callHistory = toCallHistoryFromUnusedCallLink(callLink);
|
||||
await Promise.all([
|
||||
|
|
|
@ -9,14 +9,11 @@ import { getIntl } from '../selectors/user';
|
|||
import { useGlobalModalActions } from '../ducks/globalModals';
|
||||
import { getCallLinkAddNameModalRoomId } from '../selectors/globalModals';
|
||||
import { strictAssert } from '../../util/assert';
|
||||
import { isCallLinksCreateEnabled } from '../../util/callLinks';
|
||||
import { isCallLinkAdmin } from '../../types/CallLink';
|
||||
import { CallLinkAddNameModal } from '../../components/CallLinkAddNameModal';
|
||||
|
||||
export const SmartCallLinkAddNameModal = memo(
|
||||
function SmartCallLinkAddNameModal(): JSX.Element | null {
|
||||
strictAssert(isCallLinksCreateEnabled(), 'Call links creation is disabled');
|
||||
|
||||
const roomId = useSelector(getCallLinkAddNameModalRoomId);
|
||||
strictAssert(roomId, 'Expected roomId to be set');
|
||||
|
||||
|
|
|
@ -14,12 +14,9 @@ import { strictAssert } from '../../util/assert';
|
|||
import { linkCallRoute } from '../../util/signalRoutes';
|
||||
import { copyCallLink } from '../../util/copyLinksWithToast';
|
||||
import { drop } from '../../util/drop';
|
||||
import { isCallLinksCreateEnabled } from '../../util/callLinks';
|
||||
|
||||
export const SmartCallLinkEditModal = memo(
|
||||
function SmartCallLinkEditModal(): JSX.Element | null {
|
||||
strictAssert(isCallLinksCreateEnabled(), 'Call links creation is disabled');
|
||||
|
||||
const roomId = useSelector(getCallLinkEditModalRoomId);
|
||||
strictAssert(roomId, 'Expected roomId to be set');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import React, { memo, useCallback, useEffect, useMemo } from 'react';
|
||||
import React, { memo, useCallback, useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { DataReader } from '../../sql/Client';
|
||||
import { useItemsActions } from '../ducks/items';
|
||||
|
@ -43,7 +43,6 @@ import { SmartCallLinkDetails } from './CallLinkDetails';
|
|||
import type { CallLinkType } from '../../types/CallLink';
|
||||
import { filterCallLinks } from '../../util/filterCallLinks';
|
||||
import { useGlobalModalActions } from '../ducks/globalModals';
|
||||
import { isCallLinksCreateEnabled } from '../../util/callLinks';
|
||||
|
||||
function getCallHistoryFilter({
|
||||
allCallLinks,
|
||||
|
@ -161,10 +160,6 @@ export const SmartCallsTab = memo(function SmartCallsTab() {
|
|||
const hasFailedStorySends = useSelector(getHasAnyFailedStorySends);
|
||||
const otherTabsUnreadStats = useSelector(getOtherTabsUnreadStats);
|
||||
|
||||
const canCreateCallLinks = useMemo(() => {
|
||||
return isCallLinksCreateEnabled();
|
||||
}, []);
|
||||
|
||||
const {
|
||||
createCallLink,
|
||||
hangUpActiveCall,
|
||||
|
@ -242,7 +237,6 @@ export const SmartCallsTab = memo(function SmartCallsTab() {
|
|||
getCall={getCall}
|
||||
getCallLink={getCallLink}
|
||||
callHistoryEdition={callHistoryEdition}
|
||||
canCreateCallLinks={canCreateCallLinks}
|
||||
hangUpActiveCall={hangUpActiveCall}
|
||||
hasAnyAdminCallLinks={hasAnyAdminCallLinks}
|
||||
hasFailedStorySends={hasFailedStorySends}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import { v4 as generateUuid } from 'uuid';
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
import * as Bytes from '../Bytes';
|
||||
import type { CallLinkConversationType, CallLinkType } from '../types/CallLink';
|
||||
import { CallLinkRestrictions } from '../types/CallLink';
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import { isTestOrMockEnvironment } from '../environment';
|
||||
import { getColorForCallLink } from './getColorForCallLink';
|
||||
import {
|
||||
AdhocCallStatus,
|
||||
|
@ -15,7 +13,6 @@ import {
|
|||
type CallHistoryDetails,
|
||||
CallMode,
|
||||
} from '../types/CallDisposition';
|
||||
import { isBeta, isProduction } from './version';
|
||||
|
||||
export const CALL_LINK_DEFAULT_STATE: Pick<
|
||||
CallLinkType,
|
||||
|
@ -40,26 +37,6 @@ export function getKeyFromCallLink(callLink: string): string {
|
|||
return hashParams.get('key') || '';
|
||||
}
|
||||
|
||||
export function isCallLinksCreateEnabled(): boolean {
|
||||
if (isTestOrMockEnvironment()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const version = window.getVersion();
|
||||
|
||||
if (isProduction(version)) {
|
||||
return RemoteConfig.getValue('desktop.calling.adhoc.create') === 'TRUE';
|
||||
}
|
||||
|
||||
if (isBeta(version)) {
|
||||
return (
|
||||
RemoteConfig.getValue('desktop.calling.adhoc.create.beta') === 'TRUE'
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export function callLinkToConversation(
|
||||
callLink: CallLinkType,
|
||||
i18n: LocalizerType
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as RemoteConfig from '../RemoteConfig';
|
||||
import { isBeta, isProduction } from './version';
|
||||
|
||||
export function isAdhocCallingEnabled(): boolean {
|
||||
const version = window.getVersion();
|
||||
|
||||
if (isProduction(version)) {
|
||||
return Boolean(RemoteConfig.isEnabled('desktop.calling.adhoc'));
|
||||
}
|
||||
|
||||
if (isBeta(version)) {
|
||||
return Boolean(RemoteConfig.isEnabled('desktop.calling.adhoc.beta'));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
|
@ -22,7 +22,6 @@ import type {
|
|||
NotificationClickData,
|
||||
WindowsNotificationData,
|
||||
} from '../../services/notifications';
|
||||
import { isAdhocCallingEnabled } from '../../util/isAdhocCallingEnabled';
|
||||
import { AggregatedStats } from '../../textsecure/WebsocketResources';
|
||||
import { UNAUTHENTICATED_CHANNEL_NAME } from '../../textsecure/SocketManager';
|
||||
|
||||
|
@ -350,16 +349,9 @@ ipc.on('start-call-lobby', (_event, { conversationId }) => {
|
|||
});
|
||||
|
||||
ipc.on('start-call-link', (_event, { key }) => {
|
||||
if (isAdhocCallingEnabled()) {
|
||||
window.reduxActions?.calling?.startCallLinkLobby({
|
||||
rootKey: key,
|
||||
});
|
||||
} else {
|
||||
const { unknownSignalLink } = window.Events;
|
||||
if (unknownSignalLink) {
|
||||
unknownSignalLink();
|
||||
}
|
||||
}
|
||||
window.reduxActions?.calling?.startCallLinkLobby({
|
||||
rootKey: key,
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on('show-window', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue