Show UDDialog on m.call.invite failure

Requires https://github.com/matrix-org/matrix-js-sdk/pull/378

Also, refactored UDDialog creation into its own dispatch event, because there will be other parts of the code that will want to spawn one.
This commit is contained in:
Luke Barnard 2017-02-21 17:22:22 +00:00
parent 05d242cb5c
commit 878e31eba2
5 changed files with 34 additions and 23 deletions

View file

@ -100,8 +100,16 @@ function pause(audioId) {
function _setCallListeners(call) {
call.on("error", function(err) {
console.error("Call error: %s", err);
console.error(err.stack);
if (err.name === "UnknownDeviceError") {
dis.dispatch({
action: 'unknown_device_error',
err: err,
room: MatrixClientPeg.get().getRoom(call.roomId),
});
} else {
console.error("Call error: %s", err);
console.error(err.stack);
}
call.hangup();
_setCallState(undefined, call.roomId, "ended");
});