Merge pull request #129 from matrix-org/dbkr/no_auto_join

Don't trigger joins from the room directory: always peek
pull/21833/head
David Baker 2016-02-03 15:18:38 +00:00
commit 9468ff63ff
2 changed files with 10 additions and 1 deletions

View File

@ -66,7 +66,6 @@ module.exports = React.createClass({
collapse_rhs: false, collapse_rhs: false,
ready: false, ready: false,
width: 10000, width: 10000,
autoPeek: true, // by default, we peek into rooms when we try to join them
}; };
if (s.logged_in) { if (s.logged_in) {
if (MatrixClientPeg.get().getRooms().length) { if (MatrixClientPeg.get().getRooms().length) {

View File

@ -60,6 +60,9 @@ module.exports = React.createClass({
displayName: 'RoomView', displayName: 'RoomView',
propTypes: { propTypes: {
ConferenceHandler: React.PropTypes.any, ConferenceHandler: React.PropTypes.any,
roomId: React.PropTypes.string,
autoPeek: React.PropTypes.bool, // Now unused, left here temporarily to avoid merge conflicts with @richvdh's branch.
roomId: React.PropTypes.string.isRequired, roomId: React.PropTypes.string.isRequired,
// id of an event to jump to. If not given, will use the read-up-to-marker. // id of an event to jump to. If not given, will use the read-up-to-marker.
@ -77,6 +80,12 @@ module.exports = React.createClass({
autoPeek: React.PropTypes.bool, // should we try to peek the room on mount, or has whoever invoked us already initiated a peek? autoPeek: React.PropTypes.bool, // should we try to peek the room on mount, or has whoever invoked us already initiated a peek?
}, },
getDefaultProps: function() {
return {
autoPeek: true,
}
},
/* properties in RoomView objects include: /* properties in RoomView objects include:
* *
* eventNodes: a map from event id to DOM node representing that event * eventNodes: a map from event id to DOM node representing that event
@ -487,6 +496,7 @@ module.exports = React.createClass({
this._updateTabCompleteList(this.state.room); this._updateTabCompleteList(this.state.room);
var room = MatrixClientPeg.get().getRoom(this.props.roomId); var room = MatrixClientPeg.get().getRoom(this.props.roomId);
if (!room) return;
var me = MatrixClientPeg.get().credentials.userId; var me = MatrixClientPeg.get().credentials.userId;
if (this.state.joining && room.hasMembershipState(me, "join")) { if (this.state.joining && room.hasMembershipState(me, "join")) {
this.setState({ this.setState({