diff --git a/ts/RemoteConfig.ts b/ts/RemoteConfig.ts index 05b9533c43..d530a1fab3 100644 --- a/ts/RemoteConfig.ts +++ b/ts/RemoteConfig.ts @@ -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' diff --git a/ts/components/CallsList.tsx b/ts/components/CallsList.tsx index f29766dcba..31f92bdc61 100644 --- a/ts/components/CallsList.tsx +++ b/ts/components/CallsList.tsx @@ -133,7 +133,6 @@ const defaultPendingState: SearchState = { type CallsListProps = Readonly<{ activeCall: ActiveCallStateType | undefined; - canCreateCallLinks: boolean; getCallHistoryGroupsCount: ( options: CallHistoryFilterOptions ) => Promise; @@ -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; diff --git a/ts/components/CallsTab.tsx b/ts/components/CallsTab.tsx index 59e3cf778a..654db25f97 100644 --- a/ts/components/CallsTab.tsx +++ b/ts/components/CallsTab.tsx @@ -43,7 +43,6 @@ type CallsTabProps = Readonly<{ pagination: CallHistoryPagination ) => Promise>; 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({ { return async dispatch => { - strictAssert(isCallLinksCreateEnabled(), 'Call links creation is disabled'); - const callLink = await calling.createCallLink(); const callHistory = toCallHistoryFromUnusedCallLink(callLink); await Promise.all([ diff --git a/ts/state/smart/CallLinkAddNameModal.tsx b/ts/state/smart/CallLinkAddNameModal.tsx index 506921d6ab..61028340e8 100644 --- a/ts/state/smart/CallLinkAddNameModal.tsx +++ b/ts/state/smart/CallLinkAddNameModal.tsx @@ -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'); diff --git a/ts/state/smart/CallLinkEditModal.tsx b/ts/state/smart/CallLinkEditModal.tsx index 3303099587..192902dd13 100644 --- a/ts/state/smart/CallLinkEditModal.tsx +++ b/ts/state/smart/CallLinkEditModal.tsx @@ -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'); diff --git a/ts/state/smart/CallsTab.tsx b/ts/state/smart/CallsTab.tsx index fd36c98720..216c8fab90 100644 --- a/ts/state/smart/CallsTab.tsx +++ b/ts/state/smart/CallsTab.tsx @@ -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} diff --git a/ts/util/callLinks.ts b/ts/util/callLinks.ts index 0919b37b48..0db9c1c64c 100644 --- a/ts/util/callLinks.ts +++ b/ts/util/callLinks.ts @@ -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 diff --git a/ts/util/isAdhocCallingEnabled.ts b/ts/util/isAdhocCallingEnabled.ts deleted file mode 100644 index 0cdf090fa5..0000000000 --- a/ts/util/isAdhocCallingEnabled.ts +++ /dev/null @@ -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; -} diff --git a/ts/windows/main/phase1-ipc.ts b/ts/windows/main/phase1-ipc.ts index f0d8a6bb72..aaeb270f24 100644 --- a/ts/windows/main/phase1-ipc.ts +++ b/ts/windows/main/phase1-ipc.ts @@ -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', () => {