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

Don't trigger joins from the room directory: always peek
This commit is contained in:
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,
ready: false,
width: 10000,
autoPeek: true, // by default, we peek into rooms when we try to join them
};
if (s.logged_in) {
if (MatrixClientPeg.get().getRooms().length) {

View file

@ -60,6 +60,9 @@ module.exports = React.createClass({
displayName: 'RoomView',
propTypes: {
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,
// 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?
},
getDefaultProps: function() {
return {
autoPeek: true,
}
},
/* properties in RoomView objects include:
*
* 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);
var room = MatrixClientPeg.get().getRoom(this.props.roomId);
if (!room) return;
var me = MatrixClientPeg.get().credentials.userId;
if (this.state.joining && room.hasMembershipState(me, "join")) {
this.setState({