Add error message for failing to join a room as a guest (which may or may not be because we're a guest: we can't tell)
This commit is contained in:
parent
463212fb2a
commit
13f31b2a5d
1 changed files with 22 additions and 6 deletions
|
@ -575,12 +575,28 @@ module.exports = React.createClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!error) return;
|
if (!error) return;
|
||||||
var msg = error.message ? error.message : JSON.stringify(error);
|
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
// https://matrix.org/jira/browse/SYN-659
|
||||||
Modal.createDialog(ErrorDialog, {
|
if (
|
||||||
title: "Failed to join room",
|
error.errcode == 'M_GUEST_ACCESS_FORBIDDEN' ||
|
||||||
description: msg
|
(
|
||||||
});
|
error.errcode == 'M_FORBIDDEN' &&
|
||||||
|
MatrixClientPeg.get().isGuest()
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog");
|
||||||
|
Modal.createDialog(NeedToRegisterDialog, {
|
||||||
|
title: "Failed to join the room",
|
||||||
|
description: "This room is private or inaccessible to guests. You may be able to join if you register."
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
var msg = error.message ? error.message : JSON.stringify(error);
|
||||||
|
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
|
Modal.createDialog(ErrorDialog, {
|
||||||
|
title: "Failed to join room",
|
||||||
|
description: msg
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.setState({
|
this.setState({
|
||||||
joining: true
|
joining: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue