Fix cleaning unread state on room select & ignore our own messages

This commit is contained in:
David Baker 2015-06-18 14:40:55 +01:00
parent 7c405f673a
commit 90f6764cbf

View file

@ -23,8 +23,8 @@ module.exports = React.createClass({
} }
}, },
componentWillReceiveProps: function() { componentWillReceiveProps: function(newProps) {
this.state.activityMap[this.props.selectedRoom] = undefined; this.state.activityMap[newProps.selectedRoom] = undefined;
this.setState({ this.setState({
activityMap: this.state.activityMap activityMap: this.state.activityMap
}); });
@ -32,6 +32,7 @@ module.exports = React.createClass({
onRoomTimeline: function(ev, room, toStartOfTimeline) { onRoomTimeline: function(ev, room, toStartOfTimeline) {
if (room.roomId == this.props.selectedRoom) return; if (room.roomId == this.props.selectedRoom) return;
if (ev.getSender() == MatrixClientPeg.get().credentials.userId) return;
// obviously this won't deep copy but we this shouldn't be necessary // obviously this won't deep copy but we this shouldn't be necessary
var amap = this.state.activityMap; var amap = this.state.activityMap;