Highlight room tiles on bing

This commit is contained in:
David Baker 2015-06-29 16:48:13 +01:00
parent 57ba816919
commit 46646cbd87
3 changed files with 13 additions and 1 deletions

View file

@ -40,6 +40,10 @@ limitations under the License.
background-color: #66e; background-color: #66e;
} }
.mx_RoomTile.highlight {
background-color: lime;
}
.mx_RoomTile.invited { .mx_RoomTile.invited {
background-color: #6e6; background-color: #6e6;
} }

View file

@ -32,6 +32,7 @@ module.exports = React.createClass({
'mx_RoomTile': true, 'mx_RoomTile': true,
'selected': this.props.selected, 'selected': this.props.selected,
'unread': this.props.unread, 'unread': this.props.unread,
'highlight': this.props.highlight,
'invited': this.props.room.currentState.members[myUserId].membership == 'invite' 'invited': this.props.room.currentState.members[myUserId].membership == 'invite'
}); });
return ( return (

View file

@ -63,9 +63,16 @@ module.exports = {
if (room.roomId == this.props.selectedRoom) return; if (room.roomId == this.props.selectedRoom) return;
if (ev.getSender() == MatrixClientPeg.get().credentials.userId) return; if (ev.getSender() == MatrixClientPeg.get().credentials.userId) return;
var hl = 1;
var actions = ev.getPushActions(MatrixClientPeg.get());
if (actions || actions.tweaks && actions.tweaks.highlight) {
hl = 2;
}
// 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;
amap[room.roomId] = 1; amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl);
this.setState({ this.setState({
activityMap: amap activityMap: amap
}); });