From f940d2c1007e346ca3455c456aa2b83687884844 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Sat, 10 Jun 2017 16:30:46 +0100 Subject: [PATCH] Add reason for ban in room settings --- src/components/views/rooms/RoomSettings.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index b8aafca1a3..1d3126764c 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -40,6 +40,7 @@ function parseIntWithDefault(val, def) { const BannedUser = React.createClass({ propTypes: { member: React.PropTypes.object.isRequired, // js-sdk RoomMember + reason: React.PropTypes.string, }, _onUnbanClick: function() { @@ -73,10 +74,11 @@ const BannedUser = React.createClass({ > { _t('Unban') } - {this.props.member.userId} + {this.props.member.name} + {this.props.reason ? " " +_t('Reason') + ": " + this.props.reason : ""} ); - } + }, }); module.exports = React.createClass({ @@ -662,16 +664,17 @@ module.exports = React.createClass({ userLevelsSection =
{ _t('No users have specific privileges in this room') }.
; } - var banned = this.props.room.getMembersWithMembership("ban"); - var bannedUsersSection; + const banned = this.props.room.getMembersWithMembership("ban"); + let bannedUsersSection; if (banned.length) { bannedUsersSection =

{ _t('Banned users') }