Add a forget button. Add left rooms to the "historical" tab.

Call /forget when the forget button is clicked. Number of shortcomings:
 - We need to lazy load the historical list (atm we never get the list of left
   rooms; things only go into that list if you leave the room whilst running)
 - Once a room is forgotten we need to physically nuke it from the JS SDK.
 - Need icon for forget room.
This commit is contained in:
Kegan Dougal 2015-12-16 16:06:29 +00:00
parent 186b727303
commit f7aa8be1c1
3 changed files with 35 additions and 4 deletions

View file

@ -824,7 +824,14 @@ module.exports = React.createClass({
action: 'leave_room',
room_id: this.props.roomId,
});
this.props.onFinished();
},
onForgetClick: function() {
MatrixClientPeg.get().forget(this.props.roomId).done(function() {
dis.dispatch({ action: 'view_next_room' });
}, function(err) {
console.error("Failed to forget room: %s", err);
});
},
onRejectButtonClicked: function(ev) {
@ -1249,8 +1256,18 @@ module.exports = React.createClass({
return (
<div className={ "mx_RoomView" + (inCall ? " mx_RoomView_inCall" : "") }>
<RoomHeader ref="header" room={this.state.room} searchInfo={searchInfo} editing={this.state.editingRoomSettings} onSearchClick={this.onSearchClick}
onSettingsClick={this.onSettingsClick} onSaveClick={this.onSaveClick} onCancelClick={this.onCancelClick} onLeaveClick={this.onLeaveClick} />
<RoomHeader ref="header" room={this.state.room} searchInfo={searchInfo}
editing={this.state.editingRoomSettings}
onSearchClick={this.onSearchClick}
onSettingsClick={this.onSettingsClick}
onSaveClick={this.onSaveClick}
onCancelClick={this.onCancelClick}
onForgetClick={
(myMember && myMember.membership === "leave") ? this.onForgetClick : null
}
onLeaveClick={
(myMember && myMember.membership === "join") ? this.onLeaveClick : null
} />
{ fileDropTarget }
<div className="mx_RoomView_auxPanel">
<CallView ref="callView" room={this.state.room} ConferenceHandler={this.props.ConferenceHandler}/>