From c6d9ec42a2a4545f44f00635cdeb91d90fda3af3 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Thu, 6 Jul 2017 12:51:55 +0100
Subject: [PATCH] only show unban button in RoomSettings if user has sufficient
PL to do so
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/RoomSettings.js | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js
index 171af4764b..d255670a52 100644
--- a/src/components/views/rooms/RoomSettings.js
+++ b/src/components/views/rooms/RoomSettings.js
@@ -39,6 +39,7 @@ function parseIntWithDefault(val, def) {
const BannedUser = React.createClass({
propTypes: {
+ canUnban: React.PropTypes.bool,
member: React.PropTypes.object.isRequired, // js-sdk RoomMember
reason: React.PropTypes.string,
},
@@ -67,13 +68,17 @@ const BannedUser = React.createClass({
},
render: function() {
+ let unbanButton;
+
+ if (this.props.canUnban) {
+ unbanButton =