Merge pull request #5712 from matrix-org/dbkr/dont_place_multiple_calls

Don't place another call if there's already one ongoing
This commit is contained in:
David Baker 2021-03-03 20:36:16 +00:00 committed by GitHub
commit 2f52412834
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -706,6 +706,14 @@ export default class CallHandler {
return; return;
} }
if (this.getCallForRoom(room.roomId)) {
Modal.createTrackedDialog('Call Handler', 'Existing Call with user', ErrorDialog, {
title: _t('Already in call'),
description: _t("You're already in a call with this person."),
});
return;
}
const members = room.getJoinedMembers(); const members = room.getJoinedMembers();
if (members.length <= 1) { if (members.length <= 1) {
Modal.createTrackedDialog('Call Handler', 'Cannot place call with self', ErrorDialog, { Modal.createTrackedDialog('Call Handler', 'Cannot place call with self', ErrorDialog, {

View file

@ -58,6 +58,8 @@
"You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.", "You cannot place VoIP calls in this browser.": "You cannot place VoIP calls in this browser.",
"Too Many Calls": "Too Many Calls", "Too Many Calls": "Too Many Calls",
"You've reached the maximum number of simultaneous calls.": "You've reached the maximum number of simultaneous calls.", "You've reached the maximum number of simultaneous calls.": "You've reached the maximum number of simultaneous calls.",
"Already in call": "Already in call",
"You're already in a call with this person.": "You're already in a call with this person.",
"You cannot place a call with yourself.": "You cannot place a call with yourself.", "You cannot place a call with yourself.": "You cannot place a call with yourself.",
"Call in Progress": "Call in Progress", "Call in Progress": "Call in Progress",
"A call is currently being placed!": "A call is currently being placed!", "A call is currently being placed!": "A call is currently being placed!",