You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
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:
@ -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
|
||||||
|
Reference in New Issue
Block a user