Make unknown failures more helpful.

This commit is contained in:
Will Hunt 2017-06-10 14:35:11 +01:00
parent 18490377f8
commit 2bfad52b40
3 changed files with 6 additions and 6 deletions

View File

@ -145,15 +145,15 @@ function textForCallHangupEvent(event) {
const eventContent = event.getContent();
let reason = "";
if(!MatrixClientPeg.get().supportsVoip()) {
reason = '(not supported by this browser)';
reason = _t('(not supported by this browser)');
} else if(eventContent.reason) {
if (eventContent.reason === "ice_failed") {
reason = "(call failed to connect)";
reason = _t('(call failed to connect)');
} else {
reason = `(${eventContent.reason})`;
reason = _t('(unknown failure: %(reason)s)', {reason: eventContent.reason});
}
}
return _t('%(senderName)s ended the call.', {senderName}) + ' ' + _t(reason);
return _t('%(senderName)s ended the call.', {senderName}) + ' ' + reason;
}
function textForCallInviteEvent(event) {

View File

@ -638,7 +638,7 @@
"VoIP conference started.": "VoIP conference started.",
"VoIP is unsupported": "VoIP is unsupported",
"(call failed to connect)": "(call failed to connect)",
"(unknown failure)": "(unknown failure)",
"(unknown failure: %(reason)s)": "(unknown failure: %(reason)s)",
"(warning: cannot be disabled again!)": "(warning: cannot be disabled again!)",
"Warning!": "Warning!",
"WARNING: Device already verified, but keys do NOT MATCH!": "WARNING: Device already verified, but keys do NOT MATCH!",

View File

@ -577,7 +577,7 @@
"VoIP conference started.": "VoIP conference started.",
"VoIP is unsupported": "VoIP is unsupported",
"(call failed to connect)": "(call failed to connect)",
"(unknown failure)": "(unknown failure)",
"(unknown failure: %(reason)s)": "(unknown failure: %(reason)s)",
"(warning: cannot be disabled again!)": "(warning: cannot be disabled again!)",
"Warning!": "Warning!",
"WARNING: Device already verified, but keys do NOT MATCH!": "WARNING: Device already verified, but keys do NOT MATCH!",