Handle starting a call while listen to a broadcast (#9764)

This commit is contained in:
Michael Weimann
2022-12-19 08:44:19 +00:00
committed by GitHub
parent af3715821b
commit 35a187a231
8 changed files with 312 additions and 29 deletions
+11
View File
@@ -63,6 +63,8 @@ import { OpenInviteDialogPayload } from "./dispatcher/payloads/OpenInviteDialogP
import { findDMForUser } from "./utils/dm/findDMForUser";
import { getJoinedNonFunctionalMembers } from "./utils/room/getJoinedNonFunctionalMembers";
import { localNotificationsAreSilenced } from "./utils/notifications";
import { SdkContextClass } from "./contexts/SDKContext";
import { showCantStartACallDialog } from "./voice-broadcast/utils/showCantStartACallDialog";
export const PROTOCOL_PSTN = "m.protocol.pstn";
export const PROTOCOL_PSTN_PREFIXED = "im.vector.protocol.pstn";
@@ -932,6 +934,15 @@ export default class LegacyCallHandler extends EventEmitter {
}
public async placeCall(roomId: string, type?: CallType, transferee?: MatrixCall): Promise<void> {
// Pause current broadcast, if any
SdkContextClass.instance.voiceBroadcastPlaybacksStore.getCurrent()?.pause();
if (SdkContextClass.instance.voiceBroadcastRecordingsStore.getCurrent()) {
// Do not start a call, if recording a broadcast
showCantStartACallDialog();
return;
}
// We might be using managed hybrid widgets
if (isManagedHybridWidgetEnabled()) {
await addManagedHybridWidget(roomId);