From 765fdf93e6304f49bb30981bf17d773b5cb7654c Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 21 Oct 2020 11:54:48 +0100 Subject: [PATCH] Support 'answered elsewhere' Show a dialog for now, telling the user someone beat them to it. Only useful with https://github.com/matrix-org/matrix-js-sdk/pull/1522 (but can be merged safely without). --- src/CallHandler.tsx | 6 ++++++ src/i18n/strings/en_EN.json | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx index b788ec7da1..e303dd3819 100644 --- a/src/CallHandler.tsx +++ b/src/CallHandler.tsx @@ -262,6 +262,12 @@ export default class CallHandler { Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { title, description, }); + } else if (call.hangupReason === CallErrorCode.AnsweredElsewhere) { + this.play(AudioID.Busy); + Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { + title: _t("Answered Elsewhere"), + description: _t("The call was answered on another device."), + }); } else { this.play(AudioID.CallEnd); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index e79a098920..8bff00c073 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -39,6 +39,8 @@ "The other party declined the call.": "The other party declined the call.", "The remote side failed to pick up": "The remote side failed to pick up", "The call could not be established": "The call could not be established", + "Answered Elsewhere": "Answered Elsewhere", + "The call was answered on another device.": "The call was answered on another device.", "Call failed due to misconfigured server": "Call failed due to misconfigured server", "Please ask the administrator of your homeserver (%(homeserverDomain)s) to configure a TURN server in order for calls to work reliably.": "Please ask the administrator of your homeserver (%(homeserverDomain)s) to configure a TURN server in order for calls to work reliably.", "Alternatively, you can try to use the public server at turn.matrix.org, but this will not be as reliable, and it will share your IP address with that server. You can also manage this in Settings.": "Alternatively, you can try to use the public server at turn.matrix.org, but this will not be as reliable, and it will share your IP address with that server. You can also manage this in Settings.",