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:
parent
05d242cb5c
commit
878e31eba2
5 changed files with 34 additions and 23 deletions
|
@ -100,8 +100,16 @@ function pause(audioId) {
|
|||
|
||||
function _setCallListeners(call) {
|
||||
call.on("error", function(err) {
|
||||
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");
|
||||
});
|
||||
|
|
|
@ -21,8 +21,9 @@ var Modal = require('./Modal');
|
|||
|
||||
module.exports = {
|
||||
resend: function(event) {
|
||||
const room = MatrixClientPeg.get().getRoom(event.getRoomId());
|
||||
MatrixClientPeg.get().resendEvent(
|
||||
event, MatrixClientPeg.get().getRoom(event.getRoomId())
|
||||
event, room
|
||||
).done(function(res) {
|
||||
dis.dispatch({
|
||||
action: 'message_sent',
|
||||
|
@ -33,16 +34,11 @@ module.exports = {
|
|||
// https://github.com/vector-im/riot-web/issues/3148
|
||||
console.log('Resend got send failure: ' + err.name + '('+err+')');
|
||||
if (err.name === "UnknownDeviceError") {
|
||||
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||
Modal.createDialog(UnknownDeviceDialog, {
|
||||
devices: err.devices,
|
||||
room: MatrixClientPeg.get().getRoom(event.getRoomId()),
|
||||
onFinished: (r) => {
|
||||
// XXX: temporary logging to try to diagnose
|
||||
// https://github.com/vector-im/riot-web/issues/3148
|
||||
console.log('UnknownDeviceDialog closed with '+r);
|
||||
},
|
||||
}, "mx_Dialog_unknownDevice");
|
||||
dis.dispatch({
|
||||
action: 'unknown_device_error',
|
||||
err: err,
|
||||
room: room,
|
||||
});
|
||||
}
|
||||
|
||||
dis.dispatch({
|
||||
|
|
|
@ -518,6 +518,18 @@ module.exports = React.createClass({
|
|||
case 'set_theme':
|
||||
this._onSetTheme(payload.value);
|
||||
break;
|
||||
case 'unknown_device_error':
|
||||
var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||
Modal.createDialog(UnknownDeviceDialog, {
|
||||
devices: payload.err.devices,
|
||||
room: payload.room,
|
||||
onFinished: (r) => {
|
||||
// XXX: temporary logging to try to diagnose
|
||||
// https://github.com/vector-im/riot-web/issues/3148
|
||||
console.log('UnknownDeviceDialog closed with '+r);
|
||||
},
|
||||
}, "mx_Dialog_unknownDevice");
|
||||
break;
|
||||
case 'on_logged_in':
|
||||
this._onLoggedIn();
|
||||
break;
|
||||
|
|
|
@ -85,7 +85,7 @@ UnknownDeviceList.propTypes = {
|
|||
|
||||
|
||||
export default React.createClass({
|
||||
displayName: 'UnknownEventDialog',
|
||||
displayName: 'UnknownDeviceDialog',
|
||||
|
||||
propTypes: {
|
||||
room: React.PropTypes.object.isRequired,
|
||||
|
|
|
@ -34,16 +34,11 @@ export function onSendMessageFailed(err, room) {
|
|||
// https://github.com/vector-im/riot-web/issues/3148
|
||||
console.log('MessageComposer got send failure: ' + err.name + '('+err+')');
|
||||
if (err.name === "UnknownDeviceError") {
|
||||
const UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog");
|
||||
Modal.createDialog(UnknownDeviceDialog, {
|
||||
devices: err.devices,
|
||||
dis.dispatch({
|
||||
action: 'unknown_device_error',
|
||||
err: err,
|
||||
room: room,
|
||||
onFinished: (r) => {
|
||||
// XXX: temporary logging to try to diagnose
|
||||
// https://github.com/vector-im/riot-web/issues/3148
|
||||
console.log('UnknownDeviceDialog closed with '+r);
|
||||
},
|
||||
}, "mx_Dialog_unknownDevice");
|
||||
});
|
||||
}
|
||||
dis.dispatch({
|
||||
action: 'message_send_failed',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue