Fixed joining ongoing video call by a non-admin on an announcement-only group
This commit is contained in:
parent
07ab071c3d
commit
299044f89f
2 changed files with 24 additions and 8 deletions
|
@ -570,11 +570,6 @@ type SetOutgoingRingActionType = {
|
||||||
payload: boolean;
|
payload: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ShowCallLobbyActionType = {
|
|
||||||
type: 'calling/START_CALLING_LOBBY';
|
|
||||||
payload: StartCallingLobbyPayloadType;
|
|
||||||
};
|
|
||||||
|
|
||||||
type StartDirectCallActionType = {
|
type StartDirectCallActionType = {
|
||||||
type: 'calling/START_DIRECT_CALL';
|
type: 'calling/START_DIRECT_CALL';
|
||||||
payload: StartDirectCallType;
|
payload: StartDirectCallType;
|
||||||
|
@ -636,7 +631,6 @@ export type CallingActionType =
|
||||||
| SetLocalVideoFulfilledActionType
|
| SetLocalVideoFulfilledActionType
|
||||||
| SetPresentingSourcesActionType
|
| SetPresentingSourcesActionType
|
||||||
| SetOutgoingRingActionType
|
| SetOutgoingRingActionType
|
||||||
| ShowCallLobbyActionType
|
|
||||||
| StartDirectCallActionType
|
| StartDirectCallActionType
|
||||||
| ToggleNeedsScreenRecordingPermissionsActionType
|
| ToggleNeedsScreenRecordingPermissionsActionType
|
||||||
| ToggleParticipantsActionType
|
| ToggleParticipantsActionType
|
||||||
|
|
|
@ -113,6 +113,9 @@ import { sendDeleteForEveryoneMessage } from '../util/sendDeleteForEveryoneMessa
|
||||||
import { SECOND } from '../util/durations';
|
import { SECOND } from '../util/durations';
|
||||||
import { blockSendUntilConversationsAreVerified } from '../util/blockSendUntilConversationsAreVerified';
|
import { blockSendUntilConversationsAreVerified } from '../util/blockSendUntilConversationsAreVerified';
|
||||||
import { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog';
|
import { SafetyNumberChangeSource } from '../components/SafetyNumberChangeDialog';
|
||||||
|
import { getOwn } from '../util/getOwn';
|
||||||
|
import { CallMode } from '../types/Calling';
|
||||||
|
import { isAnybodyElseInGroupCall } from '../state/ducks/calling';
|
||||||
|
|
||||||
type AttachmentOptions = {
|
type AttachmentOptions = {
|
||||||
messageId: string;
|
messageId: string;
|
||||||
|
@ -650,10 +653,29 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
|
||||||
async onOutgoingVideoCallInConversation(): Promise<void> {
|
async onOutgoingVideoCallInConversation(): Promise<void> {
|
||||||
log.info('onOutgoingVideoCallInConversation: about to start a video call');
|
log.info('onOutgoingVideoCallInConversation: about to start a video call');
|
||||||
|
|
||||||
|
// if it's a group call on an announcementsOnly group
|
||||||
|
// only allow join if the call has already been started (presumably by the admin)
|
||||||
if (this.model.get('announcementsOnly') && !this.model.areWeAdmin()) {
|
if (this.model.get('announcementsOnly') && !this.model.areWeAdmin()) {
|
||||||
|
const call = getOwn(
|
||||||
|
window.reduxStore.getState().calling.callsByConversation,
|
||||||
|
this.model.id
|
||||||
|
);
|
||||||
|
|
||||||
|
// technically not necessary, but isAnybodyElseInGroupCall requires it
|
||||||
|
const ourUuid = window.storage.user.getCheckedUuid().toString();
|
||||||
|
|
||||||
|
const isOngoingGroupCall =
|
||||||
|
call &&
|
||||||
|
ourUuid &&
|
||||||
|
call.callMode === CallMode.Group &&
|
||||||
|
call.peekInfo &&
|
||||||
|
isAnybodyElseInGroupCall(call.peekInfo, ourUuid);
|
||||||
|
|
||||||
|
if (!isOngoingGroupCall) {
|
||||||
showToast(ToastCannotStartGroupCall);
|
showToast(ToastCannotStartGroupCall);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (await this.isCallSafe()) {
|
if (await this.isCallSafe()) {
|
||||||
log.info(
|
log.info(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue