Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1636 from matrix-org/luke/allow-guest-access-mygr…
Browse files Browse the repository at this point in the history
…oups

Allow guest to see MyGroups, show ILAG when creating a group
  • Loading branch information
dbkr committed Nov 28, 2017
2 parents bbaa46f + a8594a5 commit 6c283e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ const ONBOARDING_FLOW_STARTERS = [
'view_user_settings',
'view_create_chat',
'view_create_room',
'view_my_groups',
'view_group',
'view_create_group',
];

module.exports = React.createClass({
Expand Down Expand Up @@ -501,6 +500,11 @@ module.exports = React.createClass({
case 'view_create_room':
this._createRoom();
break;
case 'view_create_group': {
const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog");
Modal.createTrackedDialog('Create Community', '', CreateGroupDialog);
}
break;
case 'view_room_directory':
this._setPage(PageTypes.RoomDirectory);
this.notifyNewScreen('directory');
Expand Down
10 changes: 7 additions & 3 deletions src/components/structures/MyGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import React from 'react';
import GeminiScrollbar from 'react-gemini-scrollbar';
import sdk from '../../index';
import { _t } from '../../languageHandler';
import dis from '../../dispatcher';
import withMatrixClient from '../../wrappers/withMatrixClient';
import AccessibleButton from '../views/elements/AccessibleButton';
import Modal from '../../Modal';

export default withMatrixClient(React.createClass({
displayName: 'MyGroups',
Expand All @@ -41,14 +41,18 @@ export default withMatrixClient(React.createClass({
},

_onCreateGroupClick: function() {
const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog");
Modal.createTrackedDialog('Create Community', '', CreateGroupDialog);
dis.dispatch({action: 'view_create_group'});
},

_fetch: function() {
this.props.matrixClient.getJoinedGroups().done((result) => {
this.setState({groups: result.groups, error: null});
}, (err) => {
if (err.errcode === 'M_GUEST_ACCESS_FORBIDDEN') {
// Indicate that the guest isn't in any groups (which should be true)
this.setState({groups: [], error: null});
return;
}
this.setState({groups: null, error: err});
});
},
Expand Down

0 comments on commit 6c283e2

Please sign in to comment.