diff --git a/app/products/calls/alerts.ts b/app/products/calls/alerts.ts index 598fc18d5..7c5ae9d08 100644 --- a/app/products/calls/alerts.ts +++ b/app/products/calls/alerts.ts @@ -243,7 +243,7 @@ export const needsRecordingAlert = () => { recordingAlertLock = false; }; -export const recordingAlert = (isHost: boolean, intl: IntlShape) => { +export const recordingAlert = (isHost: boolean, transcriptionsEnabled: boolean, intl: IntlShape) => { if (recordingAlertLock) { return; } @@ -251,22 +251,46 @@ export const recordingAlert = (isHost: boolean, intl: IntlShape) => { const {formatMessage} = intl; - const participantTitle = formatMessage({ - id: 'mobile.calls_participant_rec_title', - defaultMessage: 'Recording is in progress', - }); const hostTitle = formatMessage({ id: 'mobile.calls_host_rec_title', defaultMessage: 'You are recording', }); + const hostMessage = formatMessage({ + id: 'mobile.calls_host_rec', + defaultMessage: 'Consider letting everyone know that this meeting is being recorded.', + }); + + const participantTitle = formatMessage({ + id: 'mobile.calls_participant_rec_title', + defaultMessage: 'Recording is in progress', + }); const participantMessage = formatMessage({ id: 'mobile.calls_participant_rec', defaultMessage: 'The host has started recording this meeting. By staying in the meeting you give consent to being recorded.', }); - const hostMessage = formatMessage({ - id: 'mobile.calls_host_rec', - defaultMessage: 'You are recording this meeting. Consider letting everyone know that this meeting is being recorded.', + + const hostTranscriptionTitle = formatMessage({ + id: 'mobile.calls_host_transcription_title', + defaultMessage: 'Recording and transcription has started', }); + const hostTranscriptionMessage = formatMessage({ + id: 'mobile.calls_host_transcription', + defaultMessage: 'Consider letting everyone know that this meeting is being recorded and transcribed.', + }); + + const participantTranscriptionTitle = formatMessage({ + id: 'mobile.calls_participant_transcription_title', + defaultMessage: 'Recording and transcription is in progress', + }); + const participantTranscriptionMessage = formatMessage({ + id: 'mobile.calls_participant_transcription', + defaultMessage: 'The host has started recording and transcription for this meeting. By staying in the meeting, you give consent to being recorded and transcribed.', + }); + + const hTitle = transcriptionsEnabled ? hostTranscriptionTitle : hostTitle; + const hMessage = transcriptionsEnabled ? hostTranscriptionMessage : hostMessage; + const pTitle = transcriptionsEnabled ? participantTranscriptionTitle : participantTitle; + const pMessage = transcriptionsEnabled ? participantTranscriptionMessage : participantMessage; const participantButtons = [ { @@ -295,8 +319,8 @@ export const recordingAlert = (isHost: boolean, intl: IntlShape) => { }]; Alert.alert( - isHost ? hostTitle : participantTitle, - isHost ? hostMessage : participantMessage, + isHost ? hTitle : pTitle, + isHost ? hMessage : pMessage, isHost ? hostButton : participantButtons, ); }; diff --git a/app/products/calls/components/current_call_bar/current_call_bar.tsx b/app/products/calls/components/current_call_bar/current_call_bar.tsx index b4e1d3c51..b618dd94c 100644 --- a/app/products/calls/components/current_call_bar/current_call_bar.tsx +++ b/app/products/calls/components/current_call_bar/current_call_bar.tsx @@ -12,11 +12,12 @@ import CallDuration from '@calls/components/call_duration'; import MessageBar from '@calls/components/message_bar'; import UnavailableIconWrapper from '@calls/components/unavailable_icon_wrapper'; import {usePermissionsChecker} from '@calls/hooks'; -import {setCallQualityAlertDismissed, setMicPermissionsErrorDismissed} from '@calls/state'; +import {setCallQualityAlertDismissed, setMicPermissionsErrorDismissed, useCallsConfig} from '@calls/state'; import {makeCallsTheme} from '@calls/utils'; import CompassIcon from '@components/compass_icon'; import {Calls, Screens} from '@constants'; import {CURRENT_CALL_BAR_HEIGHT} from '@constants/view'; +import {useServerUrl} from '@context/server'; import {useTheme} from '@context/theme'; import {allOrientations, dismissAllModalsAndPopToScreen} from '@screens/navigation'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; @@ -140,6 +141,8 @@ const CurrentCallBar = ({ threadScreen, }: Props) => { const theme = useTheme(); + const serverUrl = useServerUrl(); + const {EnableTranscriptions} = useCallsConfig(serverUrl); const callsTheme = useMemo(() => makeCallsTheme(theme), [theme]); const style = getStyleSheet(callsTheme); const intl = useIntl(); @@ -209,7 +212,7 @@ const CurrentCallBar = ({ // - Recording has started and recording has not ended. const isHost = Boolean(currentCall?.hostId === mySession?.userId); if (currentCall?.recState?.start_at && !currentCall?.recState?.end_at) { - recordingAlert(isHost, intl); + recordingAlert(isHost, EnableTranscriptions, intl); } // The user should receive a recording finished alert if all of the following conditions apply: diff --git a/app/products/calls/screens/call_screen/call_screen.tsx b/app/products/calls/screens/call_screen/call_screen.tsx index 5c7180929..322415d17 100644 --- a/app/products/calls/screens/call_screen/call_screen.tsx +++ b/app/products/calls/screens/call_screen/call_screen.tsx @@ -328,7 +328,7 @@ const CallScreen = ({ const {width, height} = useWindowDimensions(); const isTablet = useIsTablet(); const serverUrl = useServerUrl(); - const {EnableRecordings} = useCallsConfig(serverUrl); + const {EnableRecordings, EnableTranscriptions} = useCallsConfig(serverUrl); usePermissionsChecker(micPermissionsGranted); const incomingCalls = useIncomingCalls(); @@ -453,7 +453,7 @@ const CallScreen = ({ const isHost = Boolean(currentCall?.hostId === mySession?.userId); const recording = Boolean(currentCall?.recState?.start_at && !currentCall.recState.end_at); if (recording) { - recordingAlert(isHost, intl); + recordingAlert(isHost, EnableTranscriptions, intl); } // The user should receive a recording finished alert if all of the following conditions apply: diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index e7025f00a..f6d0b6712 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -466,6 +466,8 @@ "mobile.calls_host_rec_stopped": "You can find the recording in this call's chat thread once it's finished processing.", "mobile.calls_host_rec_stopped_title": "Recording has stopped. Processing...", "mobile.calls_host_rec_title": "You are recording", + "mobile.calls_host_transcription": "Consider letting everyone know that this meeting is being recorded and transcribed.", + "mobile.calls_host_transcription_title": "Recording and transcription has started", "mobile.calls_incoming_dm": "{name} is inviting you to a call", "mobile.calls_incoming_gm": "{name} is inviting you to a call with {num, plural, one {# other} other {# others}}", "mobile.calls_join_call": "Join call", @@ -492,6 +494,8 @@ "mobile.calls_participant_limit_title_GA": "This call is at capacity", "mobile.calls_participant_rec": "The host has started recording this meeting. By staying in the meeting you give consent to being recorded.", "mobile.calls_participant_rec_title": "Recording is in progress", + "mobile.calls_participant_transcription": "The host has started recording and transcription for this meeting. By staying in the meeting, you give consent to being recorded and transcribed.", + "mobile.calls_participant_transcription_title": "Recording and transcription is in progress", "mobile.calls_phone": "Phone", "mobile.calls_quality_warning": "Call quality may be degraded due to unstable network conditions.", "mobile.calls_raise_hand": "Raise hand",