Cleanup hangup dialogs

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-25 10:56:04 +02:00
parent f7087d5148
commit 7c805501bc
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
1 changed files with 6 additions and 17 deletions

View File

@ -491,28 +491,17 @@ export default class CallHandler extends EventEmitter {
break; break;
case CallState.Ended: case CallState.Ended:
{ {
Analytics.trackEvent('voip', 'callEnded', 'hangupReason', call.hangupReason); const hangupReason = call.hangupReason;
Analytics.trackEvent('voip', 'callEnded', 'hangupReason', hangupReason);
this.removeCallForRoom(mappedRoomId); this.removeCallForRoom(mappedRoomId);
if (oldState === CallState.InviteSent && ( if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) {
call.hangupParty === CallParty.Remote ||
(call.hangupParty === CallParty.Local && call.hangupReason === CallErrorCode.InviteTimeout)
)) {
this.play(AudioID.Busy); this.play(AudioID.Busy);
let title; let title;
let description; let description;
if (call.hangupReason === CallErrorCode.UserHangup) { if (call.hangupReason === CallErrorCode.UserBusy) {
title = _t("Call Declined");
description = _t("The other party declined the call.");
} else if (call.hangupReason === CallErrorCode.UserBusy) {
title = _t("User Busy"); title = _t("User Busy");
description = _t("The user you called is busy."); description = _t("The user you called is busy.");
} else if (call.hangupReason === CallErrorCode.InviteTimeout) { } else if (hangupReason && ![CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) {
title = _t("Call Failed");
// XXX: full stop appended as some relic here, but these
// strings need proper input from design anyway, so let's
// not change this string until we have a proper one.
description = _t('The remote side failed to pick up') + '.';
} else {
title = _t("Call Failed"); title = _t("Call Failed");
description = _t("The call could not be established"); description = _t("The call could not be established");
} }
@ -521,7 +510,7 @@ export default class CallHandler extends EventEmitter {
title, description, title, description,
}); });
} else if ( } else if (
call.hangupReason === CallErrorCode.AnsweredElsewhere && oldState === CallState.Connecting hangupReason === CallErrorCode.AnsweredElsewhere && oldState === CallState.Connecting
) { ) {
Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, { Modal.createTrackedDialog('Call Handler', 'Call Failed', ErrorDialog, {
title: _t("Answered Elsewhere"), title: _t("Answered Elsewhere"),