From 0415869b8cd1cc7c97ed74c00d0b02083932458b Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 17 Oct 2017 16:08:19 +0100 Subject: [PATCH] Add useful functions to GroupView to inspect user flags --- src/components/structures/GroupView.js | 2 ++ src/stores/GroupStore.js | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/components/structures/GroupView.js b/src/components/structures/GroupView.js index f86519c529..e12dc22491 100644 --- a/src/components/structures/GroupView.js +++ b/src/components/structures/GroupView.js @@ -450,6 +450,8 @@ export default React.createClass({ this._groupStore.on('update', () => { this.setState({ summary: this._groupStore.getSummary(), + isGroupPublicised: this._groupStore.getGroupPublicity(), + isUserPrivileged: this._groupStore.isUserPrivileged(), error: null, }); }); diff --git a/src/stores/GroupStore.js b/src/stores/GroupStore.js index 73118993f9..c1ef4619cd 100644 --- a/src/stores/GroupStore.js +++ b/src/stores/GroupStore.js @@ -61,6 +61,14 @@ export default class GroupStore extends EventEmitter { return this._rooms; } + getGroupPublicity() { + return this._summary.user ? this._summary.user.is_publicised : null; + } + + isUserPrivileged() { + return this._summary.user ? this._summary.user.is_privileged : null; + } + addRoomToGroup(roomId) { return this._matrixClient .addRoomToGroup(this.groupId, roomId)