Use flag for calling raise hand

This commit is contained in:
ayumi-signal 2024-06-11 16:45:28 -07:00 committed by GitHub
parent 03406b15fa
commit ad3366fa5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 1 deletions

View file

@ -17,6 +17,7 @@ import { getCountryCode } from './types/PhoneNumber';
export type ConfigKeyType = export type ConfigKeyType =
| 'desktop.calling.adhoc' | 'desktop.calling.adhoc'
| 'desktop.calling.adhoc.create' | 'desktop.calling.adhoc.create'
| 'desktop.calling.raiseHand'
| 'desktop.clientExpiration' | 'desktop.clientExpiration'
| 'desktop.backup.credentialFetch' | 'desktop.backup.credentialFetch'
| 'desktop.deleteSync.send' | 'desktop.deleteSync.send'

View file

@ -88,6 +88,7 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
i18n, i18n,
incomingCall: null, incomingCall: null,
callLink: storyProps.callLink ?? undefined, callLink: storyProps.callLink ?? undefined,
isGroupCallRaiseHandEnabled: true,
me: { me: {
...getDefaultConversation({ ...getDefaultConversation({
color: AvatarColors[0], color: AvatarColors[0],

View file

@ -106,6 +106,7 @@ export type PropsType = {
denyUser: (payload: PendingUserActionPayloadType) => void; denyUser: (payload: PendingUserActionPayloadType) => void;
hasInitialLoadCompleted: boolean; hasInitialLoadCompleted: boolean;
i18n: LocalizerType; i18n: LocalizerType;
isGroupCallRaiseHandEnabled: boolean;
me: ConversationType; me: ConversationType;
notifyForCall: ( notifyForCall: (
conversationId: string, conversationId: string,
@ -164,6 +165,7 @@ function ActiveCallManager({
denyUser, denyUser,
hangUpActiveCall, hangUpActiveCall,
i18n, i18n,
isGroupCallRaiseHandEnabled,
getIsSharingPhoneNumberWithEverybody, getIsSharingPhoneNumberWithEverybody,
getGroupCallVideoFrameSource, getGroupCallVideoFrameSource,
getPresentingSources, getPresentingSources,
@ -429,6 +431,7 @@ function ActiveCallManager({
i18n={i18n} i18n={i18n}
imageDataCache={imageDataCache} imageDataCache={imageDataCache}
isCallLinkAdmin={isCallLinkAdmin} isCallLinkAdmin={isCallLinkAdmin}
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled}
me={me} me={me}
openSystemPreferencesAction={openSystemPreferencesAction} openSystemPreferencesAction={openSystemPreferencesAction}
renderEmojiPicker={renderEmojiPicker} renderEmojiPicker={renderEmojiPicker}
@ -503,6 +506,7 @@ export function CallManager({
i18n, i18n,
incomingCall, incomingCall,
isConversationTooBigToRing, isConversationTooBigToRing,
isGroupCallRaiseHandEnabled,
getIsSharingPhoneNumberWithEverybody, getIsSharingPhoneNumberWithEverybody,
me, me,
notifyForCall, notifyForCall,
@ -592,6 +596,7 @@ export function CallManager({
getPresentingSources={getPresentingSources} getPresentingSources={getPresentingSources}
hangUpActiveCall={hangUpActiveCall} hangUpActiveCall={hangUpActiveCall}
i18n={i18n} i18n={i18n}
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled}
getIsSharingPhoneNumberWithEverybody={ getIsSharingPhoneNumberWithEverybody={
getIsSharingPhoneNumberWithEverybody getIsSharingPhoneNumberWithEverybody
} }

View file

@ -193,6 +193,7 @@ const createProps = (
i18n, i18n,
imageDataCache: React.createRef<CallingImageDataCache>(), imageDataCache: React.createRef<CallingImageDataCache>(),
isCallLinkAdmin: true, isCallLinkAdmin: true,
isGroupCallRaiseHandEnabled: true,
me: getDefaultConversation({ me: getDefaultConversation({
color: AvatarColors[1], color: AvatarColors[1],
id: '6146087e-f7ef-457e-9a8d-47df1fdd6b25', id: '6146087e-f7ef-457e-9a8d-47df1fdd6b25',

View file

@ -103,6 +103,7 @@ export type PropsType = {
i18n: LocalizerType; i18n: LocalizerType;
imageDataCache: React.RefObject<CallingImageDataCache>; imageDataCache: React.RefObject<CallingImageDataCache>;
isCallLinkAdmin: boolean; isCallLinkAdmin: boolean;
isGroupCallRaiseHandEnabled: boolean;
me: ConversationType; me: ConversationType;
openSystemPreferencesAction: () => unknown; openSystemPreferencesAction: () => unknown;
renderReactionPicker: ( renderReactionPicker: (
@ -194,6 +195,7 @@ export function CallScreen({
i18n, i18n,
imageDataCache, imageDataCache,
isCallLinkAdmin, isCallLinkAdmin,
isGroupCallRaiseHandEnabled,
me, me,
openSystemPreferencesAction, openSystemPreferencesAction,
renderEmojiPicker, renderEmojiPicker,
@ -931,7 +933,7 @@ export function CallScreen({
onClick={toggleAudio} onClick={toggleAudio}
tooltipDirection={TooltipPlacement.Top} tooltipDirection={TooltipPlacement.Top}
/> />
{raiseHandButtonType && ( {isGroupCallRaiseHandEnabled && raiseHandButtonType && (
<CallingButton <CallingButton
buttonType={raiseHandButtonType} buttonType={raiseHandButtonType}
i18n={i18n} i18n={i18n}

View file

@ -37,6 +37,7 @@ import type { AciString } from '../../types/ServiceId';
import { strictAssert } from '../../util/assert'; import { strictAssert } from '../../util/assert';
import { callLinkToConversation } from '../../util/callLinks'; import { callLinkToConversation } from '../../util/callLinks';
import { callingTones } from '../../util/callingTones'; import { callingTones } from '../../util/callingTones';
import { isGroupCallRaiseHandEnabled } from '../../util/isGroupCallRaiseHandEnabled';
import { missingCaseError } from '../../util/missingCaseError'; import { missingCaseError } from '../../util/missingCaseError';
import { useAudioPlayerActions } from '../ducks/audioPlayer'; import { useAudioPlayerActions } from '../ducks/audioPlayer';
import { getActiveCall, useCallingActions } from '../ducks/calling'; import { getActiveCall, useCallingActions } from '../ducks/calling';
@ -478,6 +479,7 @@ export const SmartCallManager = memo(function SmartCallManager() {
i18n={i18n} i18n={i18n}
incomingCall={incomingCall} incomingCall={incomingCall}
isConversationTooBigToRing={isConversationTooBigToRing} isConversationTooBigToRing={isConversationTooBigToRing}
isGroupCallRaiseHandEnabled={isGroupCallRaiseHandEnabled()}
me={me} me={me}
notifyForCall={notifyForCall} notifyForCall={notifyForCall}
openSystemPreferencesAction={openSystemPreferencesAction} openSystemPreferencesAction={openSystemPreferencesAction}

View file

@ -0,0 +1,14 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as RemoteConfig from '../RemoteConfig';
import { isProduction } from './version';
export function isGroupCallRaiseHandEnabled(): boolean {
if (!isProduction(window.getVersion())) {
return true;
}
// In production, use the config
return Boolean(RemoteConfig.isEnabled('desktop.calling.raiseHand'));
}