mirror of https://github.com/vector-im/riot-web
Highlight room tiles on bing
parent
57ba816919
commit
46646cbd87
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue