mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-31 20:13:26 +01:00
Fix call remote mute receive when in pip
Co-authored-by: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com>
This commit is contained in:
@@ -145,7 +145,6 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
|
||||
setGroupCallVideoRequest: action('set-group-call-video-request'),
|
||||
setIsCallActive: action('set-is-call-active'),
|
||||
setLocalAudio: action('set-local-audio'),
|
||||
setLocalAudioRemoteMuted: action('set-local-audio-remote-muted'),
|
||||
setLocalPreviewContainer: action('set-local-preview-container'),
|
||||
setLocalVideo: action('set-local-video'),
|
||||
setRendererCanvas: action('set-renderer-canvas'),
|
||||
|
||||
@@ -35,7 +35,6 @@ import type {
|
||||
SendGroupCallReactionType,
|
||||
SetGroupCallVideoRequestType,
|
||||
SetLocalAudioType,
|
||||
SetMutedByType,
|
||||
SetLocalVideoType,
|
||||
SetRendererCanvasType,
|
||||
StartCallType,
|
||||
@@ -139,7 +138,6 @@ export type PropsType = {
|
||||
setIsCallActive: (_: boolean) => void;
|
||||
setLocalAudio: SetLocalAudioType;
|
||||
setLocalVideo: SetLocalVideoType;
|
||||
setLocalAudioRemoteMuted: SetMutedByType;
|
||||
setLocalPreviewContainer: (options: SetLocalPreviewContainerType) => void;
|
||||
setOutgoingRing: (_: boolean) => void;
|
||||
setRendererCanvas: (_: SetRendererCanvasType) => void;
|
||||
@@ -204,7 +202,6 @@ function ActiveCallManager({
|
||||
sendGroupCallReaction,
|
||||
setGroupCallVideoRequest,
|
||||
setLocalAudio,
|
||||
setLocalAudioRemoteMuted,
|
||||
setLocalPreviewContainer,
|
||||
setLocalVideo,
|
||||
setRendererCanvas,
|
||||
@@ -489,7 +486,6 @@ function ActiveCallManager({
|
||||
setLocalPreviewContainer={setLocalPreviewContainer}
|
||||
setRendererCanvas={setRendererCanvas}
|
||||
setLocalAudio={setLocalAudio}
|
||||
setLocalAudioRemoteMuted={setLocalAudioRemoteMuted}
|
||||
setLocalVideo={setLocalVideo}
|
||||
stickyControls={showParticipantsList}
|
||||
switchToPresentationView={switchToPresentationView}
|
||||
@@ -581,7 +577,6 @@ export function CallManager({
|
||||
setGroupCallVideoRequest,
|
||||
setIsCallActive,
|
||||
setLocalAudio,
|
||||
setLocalAudioRemoteMuted,
|
||||
setLocalPreviewContainer,
|
||||
setLocalVideo,
|
||||
setOutgoingRing,
|
||||
@@ -696,7 +691,6 @@ export function CallManager({
|
||||
sendGroupCallReaction={sendGroupCallReaction}
|
||||
setGroupCallVideoRequest={setGroupCallVideoRequest}
|
||||
setLocalAudio={setLocalAudio}
|
||||
setLocalAudioRemoteMuted={setLocalAudioRemoteMuted}
|
||||
setLocalPreviewContainer={setLocalPreviewContainer}
|
||||
setLocalVideo={setLocalVideo}
|
||||
setOutgoingRing={setOutgoingRing}
|
||||
|
||||
@@ -252,7 +252,6 @@ const createProps = (
|
||||
sendGroupCallReaction: action('send-group-call-reaction'),
|
||||
setGroupCallVideoRequest: action('set-group-call-video-request'),
|
||||
setLocalAudio: action('set-local-audio'),
|
||||
setLocalAudioRemoteMuted: action('set-local-audio-remote-muted'),
|
||||
setLocalPreviewContainer: action('set-local-preview-container'),
|
||||
setLocalVideo: action('set-local-video'),
|
||||
setRendererCanvas: action('set-renderer-canvas'),
|
||||
|
||||
@@ -14,7 +14,6 @@ import type {
|
||||
SetLocalAudioType,
|
||||
SetLocalVideoType,
|
||||
SetRendererCanvasType,
|
||||
SetMutedByType,
|
||||
} from '../state/ducks/calling.preload.ts';
|
||||
import { Avatar, AvatarSize } from './Avatar.dom.tsx';
|
||||
import {
|
||||
@@ -154,7 +153,6 @@ export type PropsType = {
|
||||
toggleSelfViewExpanded: () => void;
|
||||
toggleSettings: () => void;
|
||||
changeCallView: (mode: CallViewMode) => void;
|
||||
setLocalAudioRemoteMuted: SetMutedByType;
|
||||
};
|
||||
|
||||
const REACTIONS_TOASTS_TRANSITION_FROM = {
|
||||
@@ -239,7 +237,6 @@ export function CallScreen({
|
||||
toggleScreenRecordingPermissionsDialog,
|
||||
toggleSelfViewExpanded,
|
||||
toggleSettings,
|
||||
setLocalAudioRemoteMuted,
|
||||
}: PropsType): React.JSX.Element {
|
||||
const {
|
||||
conversation,
|
||||
@@ -1131,7 +1128,6 @@ export function CallScreen({
|
||||
}
|
||||
conversationsByDemuxId={conversationsByDemuxId}
|
||||
i18n={i18n}
|
||||
setLocalAudioRemoteMuted={setLocalAudioRemoteMuted}
|
||||
/>
|
||||
{isCallLinkAdmin ? (
|
||||
<CallingPendingParticipants
|
||||
|
||||
@@ -15,7 +15,6 @@ import { difference as setDifference } from '../util/setUtil.std.ts';
|
||||
import { isMoreRecentThan } from '../util/timestamp.std.ts';
|
||||
import { isGroupOrAdhocActiveCall } from '../util/isGroupOrAdhocCall.std.ts';
|
||||
import { SECOND } from '../util/durations/index.std.ts';
|
||||
import type { SetMutedByType } from '../state/ducks/calling.preload.ts';
|
||||
|
||||
type PropsType = {
|
||||
activeCall: ActiveCallType;
|
||||
@@ -337,12 +336,10 @@ function useLowerHandSuggestionToast({
|
||||
|
||||
function useMutedByToast({
|
||||
mutedBy,
|
||||
setLocalAudioRemoteMuted,
|
||||
conversationsByDemuxId,
|
||||
i18n,
|
||||
}: {
|
||||
mutedBy: number | undefined;
|
||||
setLocalAudioRemoteMuted?: SetMutedByType;
|
||||
conversationsByDemuxId?: Map<number, ConversationType>;
|
||||
i18n: LocalizerType;
|
||||
}): void {
|
||||
@@ -352,9 +349,6 @@ function useMutedByToast({
|
||||
const MUTED_BY_TOAST_KEY = 'MUTED_BY_TOAST_KEY';
|
||||
|
||||
useEffect(() => {
|
||||
if (setLocalAudioRemoteMuted === undefined) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
mutedBy === undefined ||
|
||||
// if it's undefined, likely we just received a remote mute request
|
||||
@@ -369,7 +363,6 @@ function useMutedByToast({
|
||||
if (title === undefined) {
|
||||
return;
|
||||
}
|
||||
setLocalAudioRemoteMuted({ mutedBy });
|
||||
let content;
|
||||
if (otherConversation?.isMe) {
|
||||
content = i18n('icu:CallControls__YouMutedYourselfToast');
|
||||
@@ -394,7 +387,6 @@ function useMutedByToast({
|
||||
showToast,
|
||||
hideToast,
|
||||
MUTED_BY_TOAST_KEY,
|
||||
setLocalAudioRemoteMuted,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -486,7 +478,6 @@ type CallingButtonToastsType = {
|
||||
observedRemoteMute?: ObservedRemoteMuteType;
|
||||
conversationsByDemuxId?: Map<number, ConversationType>;
|
||||
i18n: LocalizerType;
|
||||
setLocalAudioRemoteMuted?: SetMutedByType;
|
||||
};
|
||||
|
||||
export function CallingButtonToastsContainer(
|
||||
@@ -519,7 +510,6 @@ function CallingButtonToasts({
|
||||
mutedBy,
|
||||
observedRemoteMute,
|
||||
conversationsByDemuxId,
|
||||
setLocalAudioRemoteMuted,
|
||||
}: CallingButtonToastsType) {
|
||||
useMutedToast({ hasLocalAudio, mutedBy, i18n });
|
||||
useOutgoingRingToast({ outgoingRing, i18n });
|
||||
@@ -532,7 +522,6 @@ function CallingButtonToasts({
|
||||
});
|
||||
useMutedByToast({
|
||||
mutedBy,
|
||||
setLocalAudioRemoteMuted,
|
||||
conversationsByDemuxId,
|
||||
i18n,
|
||||
});
|
||||
|
||||
@@ -116,6 +116,7 @@ import { addCallHistory, reloadCallHistory } from './callHistory.preload.ts';
|
||||
import { saveDraftRecordingIfNeeded } from './composer.preload.ts';
|
||||
import type { StartCallData } from '../../components/ConfirmLeaveCallModal.dom.tsx';
|
||||
import {
|
||||
getActiveCallState,
|
||||
getCallLinksByRoomId,
|
||||
getPresentingSource,
|
||||
} from '../selectors/calling.std.ts';
|
||||
@@ -2025,28 +2026,6 @@ function setLocalAudio(
|
||||
};
|
||||
}
|
||||
|
||||
function setLocalAudioRemoteMuted(
|
||||
payload: Parameters<SetMutedByType>[0]
|
||||
): ThunkAction<void, RootStateType, unknown, SetLocalAudioActionType> {
|
||||
return (dispatch, getState) => {
|
||||
const activeCall = getActiveCall(getState().calling);
|
||||
if (!activeCall) {
|
||||
log.warn('Trying to set local audio when no call is active');
|
||||
return;
|
||||
}
|
||||
|
||||
calling.setOutgoingAudioRemoteMuted(
|
||||
activeCall.conversationId,
|
||||
payload?.mutedBy
|
||||
);
|
||||
|
||||
dispatch({
|
||||
type: SET_LOCAL_AUDIO_FULFILLED,
|
||||
payload: { enabled: false },
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function setLocalVideo(
|
||||
payload: Parameters<SetLocalVideoType>[0]
|
||||
): ThunkAction<void, RootStateType, unknown, SetLocalVideoFulfilledActionType> {
|
||||
@@ -2089,12 +2068,26 @@ function setMutedBy(
|
||||
payload: Parameters<SetMutedByType>[0]
|
||||
): ThunkAction<void, RootStateType, unknown, SetMutedByActionType> {
|
||||
return (dispatch, getState) => {
|
||||
const activeCall = getActiveCall(getState().calling);
|
||||
const state = getState();
|
||||
const activeCall = getActiveCall(state.calling);
|
||||
if (!activeCall) {
|
||||
log.warn('Trying to set muted by when no call is active');
|
||||
return;
|
||||
}
|
||||
|
||||
const activeCallState = getActiveCallState(state);
|
||||
if (!activeCallState || !activeCallState.hasLocalAudio) {
|
||||
log.info(
|
||||
'Trying to set muted by when no active call state or already muted'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
calling.setOutgoingAudioRemoteMuted(
|
||||
activeCall.conversationId,
|
||||
payload.mutedBy
|
||||
);
|
||||
|
||||
dispatch({
|
||||
type: SET_MUTED_BY,
|
||||
payload,
|
||||
@@ -3110,7 +3103,6 @@ export const actions = {
|
||||
setIsCallActive,
|
||||
setLocalAudio,
|
||||
setLocalVideo,
|
||||
setLocalAudioRemoteMuted,
|
||||
setMutedBy,
|
||||
setOutgoingRing,
|
||||
setRendererCanvas,
|
||||
@@ -4364,13 +4356,11 @@ export function reducer(
|
||||
return state;
|
||||
}
|
||||
|
||||
const newMutedBy = activeCallState.hasLocalAudio ? mutedBy : undefined;
|
||||
|
||||
return {
|
||||
...state,
|
||||
activeCallState: {
|
||||
...activeCallState,
|
||||
mutedBy: newMutedBy,
|
||||
mutedBy,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -437,7 +437,6 @@ export const SmartCallManager = memo(function SmartCallManager() {
|
||||
setGroupCallVideoRequest,
|
||||
setIsCallActive,
|
||||
setLocalAudio,
|
||||
setLocalAudioRemoteMuted,
|
||||
setLocalVideo,
|
||||
setOutgoingRing,
|
||||
setRendererCanvas,
|
||||
@@ -497,7 +496,6 @@ export const SmartCallManager = memo(function SmartCallManager() {
|
||||
setGroupCallVideoRequest={setGroupCallVideoRequest}
|
||||
setIsCallActive={setIsCallActive}
|
||||
setLocalAudio={setLocalAudio}
|
||||
setLocalAudioRemoteMuted={setLocalAudioRemoteMuted}
|
||||
setLocalPreviewContainer={setLocalPreviewContainer}
|
||||
setLocalVideo={setLocalVideo}
|
||||
setOutgoingRing={setOutgoingRing}
|
||||
|
||||
Reference in New Issue
Block a user