mirror of https://github.com/vector-im/riot-web
Merge branch 'develop' into luke/groups-add-feature-rooms
commit
cf23ac5931
|
@ -589,8 +589,12 @@ export default React.createClass({
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
} else if (group.myMembership === 'join') {
|
} 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">
|
return <div className="mx_GroupView_invitedSection">
|
||||||
{_t("You are a member of this group")}
|
{youAreAMemberText}
|
||||||
<div className="mx_GroupView_membership_buttonContainer">
|
<div className="mx_GroupView_membership_buttonContainer">
|
||||||
<AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
|
<AccessibleButton className="mx_GroupView_textButton mx_RoomHeader_textButton"
|
||||||
onClick={this._onLeaveClick}
|
onClick={this._onLeaveClick}
|
||||||
|
@ -711,6 +715,7 @@ export default React.createClass({
|
||||||
{this._getFeaturedRoomsNode()}
|
{this._getFeaturedRoomsNode()}
|
||||||
{this._getFeaturedUsersNode()}
|
{this._getFeaturedUsersNode()}
|
||||||
</div>;
|
</div>;
|
||||||
|
if (summary.user && summary.user.is_privileged) {
|
||||||
rightButtons.push(
|
rightButtons.push(
|
||||||
<AccessibleButton className="mx_GroupHeader_button"
|
<AccessibleButton className="mx_GroupHeader_button"
|
||||||
onClick={this._onEditClick} title={_t("Edit Group")} key="_editButton"
|
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"/>
|
<TintableSvg src="img/icons-settings-room.svg" width="16" height="16"/>
|
||||||
</AccessibleButton>,
|
</AccessibleButton>,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (this.props.collapsedRhs) {
|
if (this.props.collapsedRhs) {
|
||||||
rightButtons.push(
|
rightButtons.push(
|
||||||
<AccessibleButton className="mx_GroupHeader_button"
|
<AccessibleButton className="mx_GroupHeader_button"
|
||||||
|
|
|
@ -89,6 +89,7 @@ module.exports = React.createClass({
|
||||||
cli.on("RoomMember.name", this.onRoomMemberName);
|
cli.on("RoomMember.name", this.onRoomMemberName);
|
||||||
cli.on("Event.decrypted", this.onEventDecrypted);
|
cli.on("Event.decrypted", this.onEventDecrypted);
|
||||||
cli.on("accountData", this.onAccountData);
|
cli.on("accountData", this.onAccountData);
|
||||||
|
cli.on("Group.myMembership", this._onGroupMyMembership);
|
||||||
|
|
||||||
this.refreshRoomList();
|
this.refreshRoomList();
|
||||||
|
|
||||||
|
@ -157,6 +158,7 @@ module.exports = React.createClass({
|
||||||
MatrixClientPeg.get().removeListener("RoomMember.name", this.onRoomMemberName);
|
MatrixClientPeg.get().removeListener("RoomMember.name", this.onRoomMemberName);
|
||||||
MatrixClientPeg.get().removeListener("Event.decrypted", this.onEventDecrypted);
|
MatrixClientPeg.get().removeListener("Event.decrypted", this.onEventDecrypted);
|
||||||
MatrixClientPeg.get().removeListener("accountData", this.onAccountData);
|
MatrixClientPeg.get().removeListener("accountData", this.onAccountData);
|
||||||
|
MatrixClientPeg.get().removeListener("Group.myMembership", this._onGroupMyMembership);
|
||||||
}
|
}
|
||||||
// cancel any pending calls to the rate_limited_funcs
|
// cancel any pending calls to the rate_limited_funcs
|
||||||
this._delayedRefreshRoomList.cancelPendingCall();
|
this._delayedRefreshRoomList.cancelPendingCall();
|
||||||
|
@ -236,6 +238,10 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onGroupMyMembership: function(group) {
|
||||||
|
this.forceUpdate();
|
||||||
|
},
|
||||||
|
|
||||||
_delayedRefreshRoomList: new rate_limited_func(function() {
|
_delayedRefreshRoomList: new rate_limited_func(function() {
|
||||||
this.refreshRoomList();
|
this.refreshRoomList();
|
||||||
}, 500),
|
}, 500),
|
||||||
|
|
|
@ -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:",
|
"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",
|
"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?",
|
"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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue