From 1a3ad5a3423d5a0ab5425e5adf9627845372024b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 28 Nov 2017 11:27:33 +0000 Subject: [PATCH] Allow guests to view individual groups For homeservers that still disallow guests (running synapse without https://github.com/matrix-org/synapse/pull/2715), start ILAG. --- src/components/structures/GroupView.js | 12 ++++++++++++ src/components/structures/MatrixChat.js | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index 45befdd60f..790476541c 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -495,7 +495,19 @@ export default React.createClass({ this._onEditClick(); } }); + let willDoOnboarding = false; this._groupStore.on('error', (err) => { + if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN' && !willDoOnboarding) { + dis.dispatch({ + action: 'do_after_sync_prepared', + deferred_action: { + action: 'view_group', + group_id: groupId, + }, + }); + dis.dispatch({action: 'view_set_mxid'}); + willDoOnboarding = true; + } this.setState({ summary: null, error: err, diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 23bdee4a03..e494cd7488 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -82,7 +82,6 @@ const ONBOARDING_FLOW_STARTERS = [ 'view_create_chat', 'view_create_room', 'view_my_groups', - 'view_group', ]; module.exports = React.createClass({