Merge branch 'develop' into luke/groups-add-feature-rooms

pull/21833/head
Luke Barnard 2017-09-21 17:20:12 +01:00 committed by GitHub
commit cf23ac5931
3 changed files with 22 additions and 9 deletions

View File

@ -589,8 +589,12 @@ export default React.createClass({
</div>
</div>;
} else if (group.myMembership === 'join') {
let youAreAMemberText = _t("You are a member of this group");
if (this.state.summary.user && this.state.summary.user.is_privileged) {
youAreAMemberText = _t("You are an administrator of this group");
}
return <div className="mx_GroupView_invitedSection">
{_t("You are a member of this group")}
{youAreAMemberText}
<div className="mx_GroupView_membership_buttonContainer">
<AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
onClick={this._onLeaveClick}
@ -711,6 +715,7 @@ export default React.createClass({
{this._getFeaturedRoomsNode()}
{this._getFeaturedUsersNode()}
</div>;
if (summary.user && summary.user.is_privileged) {
rightButtons.push(
<AccessibleButton className="mx_GroupHeader_button"
onClick={this._onEditClick} title={_t("Edit Group")} key="_editButton"
@ -718,6 +723,7 @@ export default React.createClass({
<TintableSvg src="img/icons-settings-room.svg" width="16" height="16"/>
</AccessibleButton>,
);
}
if (this.props.collapsedRhs) {
rightButtons.push(
<AccessibleButton className="mx_GroupHeader_button"

View File

@ -89,6 +89,7 @@ module.exports = React.createClass({
cli.on("RoomMember.name", this.onRoomMemberName);
cli.on("Event.decrypted", this.onEventDecrypted);
cli.on("accountData", this.onAccountData);
cli.on("Group.myMembership", this._onGroupMyMembership);
this.refreshRoomList();
@ -157,6 +158,7 @@ module.exports = React.createClass({
MatrixClientPeg.get().removeListener("RoomMember.name", this.onRoomMemberName);
MatrixClientPeg.get().removeListener("Event.decrypted", this.onEventDecrypted);
MatrixClientPeg.get().removeListener("accountData", this.onAccountData);
MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership);
}
// cancel any pending calls to the rate_limited_funcs
this._delayedRefreshRoomList.cancelPendingCall();
@ -236,6 +238,10 @@ module.exports = React.createClass({
}
},
_onGroupMyMembership: function(group) {
this.forceUpdate();
},
_delayedRefreshRoomList: new rate_limited_func(function() {
this.refreshRoomList();
}, 500),

View File

@ -895,5 +895,6 @@
"Failed to add the following users to the summary of %(groupId)s:": "Failed to add the following users to the summary of %(groupId)s:",
"Add rooms to the group summary": "Add rooms to the group summary",
"Which rooms would you like to add to this summary?": "Which rooms would you like to add to this summary?",
"Room name or alias": "Room name or alias"
"Room name or alias": "Room name or alias",
"You are an administrator of this group": "You are an administrator of this group"
}