From 4daf9064d9ffa44545b5ac14f572e9a7227f1380 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 9 Aug 2017 18:15:31 +0100 Subject: [PATCH] Convert to API objects & remove redundant power label --- src/components/views/groups/GroupMemberInfo.js | 7 +++++-- src/components/views/groups/GroupMemberTile.js | 6 +----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/views/groups/GroupMemberInfo.js b/src/components/views/groups/GroupMemberInfo.js index 70aa7d4504..d37afb70a9 100644 --- a/src/components/views/groups/GroupMemberInfo.js +++ b/src/components/views/groups/GroupMemberInfo.js @@ -26,6 +26,7 @@ import DMRoomMap from '../../../utils/DMRoomMap'; import Unread from '../../../Unread'; import { GroupMemberType } from '../../../groups'; import { findReadReceiptFromUserId } from '../../../utils/Receipt'; +import { groupMemberFromApiObject } from '../../../groups'; import withMatrixClient from '../../../wrappers/withMatrixClient'; import AccessibleButton from '../elements/AccessibleButton'; import GeminiScrollbar from 'react-gemini-scrollbar'; @@ -48,7 +49,9 @@ module.exports = withMatrixClient(React.createClass({ this.setState({fetching: true}); this.props.matrixClient.getGroupUsers(this.props.groupId).then((result) => { this.setState({ - members: result.chunk, + members: result.chunk.map((apiMember) => { + return groupMemberFromApiObject(apiMember); + }), fetching: false, }); }).catch((e) => { @@ -91,7 +94,7 @@ module.exports = withMatrixClient(React.createClass({ let targetIsInGroup = false; for (const m of this.state.members) { - if (m.user_id == this.props.member.userId) { + if (m.userId == this.props.member.userId) { targetIsInGroup = true; } } diff --git a/src/components/views/groups/GroupMemberTile.js b/src/components/views/groups/GroupMemberTile.js index d129fb9440..35dbd8b531 100644 --- a/src/components/views/groups/GroupMemberTile.js +++ b/src/components/views/groups/GroupMemberTile.js @@ -44,10 +44,6 @@ export default withMatrixClient(React.createClass({ }); }, - getPowerLabel: function() { - return _t("%(userName)s (power %(powerLevelNumber)s)", {userName: this.props.member.userId, powerLevelNumber: this.props.member.powerLevel}); - }, - render: function() { const BaseAvatar = sdk.getComponent('avatars.BaseAvatar'); const EntityTile = sdk.getComponent('rooms.EntityTile'); @@ -60,7 +56,7 @@ export default withMatrixClient(React.createClass({ return ( );