From 46646cbd8701dbeefd7f869274113d6f1e1317ba Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 29 Jun 2015 16:48:13 +0100 Subject: [PATCH] Highlight room tiles on bing --- skins/base/css/molecules/RoomTile.css | 4 ++++ skins/base/views/molecules/RoomTile.js | 1 + src/controllers/organisms/RoomList.js | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/skins/base/css/molecules/RoomTile.css b/skins/base/css/molecules/RoomTile.css index 782b8b74e7..408f139b9b 100644 --- a/skins/base/css/molecules/RoomTile.css +++ b/skins/base/css/molecules/RoomTile.css @@ -40,6 +40,10 @@ limitations under the License. background-color: #66e; } +.mx_RoomTile.highlight { + background-color: lime; +} + .mx_RoomTile.invited { background-color: #6e6; } diff --git a/skins/base/views/molecules/RoomTile.js b/skins/base/views/molecules/RoomTile.js index 46639c513e..0e80fc2015 100644 --- a/skins/base/views/molecules/RoomTile.js +++ b/skins/base/views/molecules/RoomTile.js @@ -32,6 +32,7 @@ module.exports = React.createClass({ 'mx_RoomTile': true, 'selected': this.props.selected, 'unread': this.props.unread, + 'highlight': this.props.highlight, 'invited': this.props.room.currentState.members[myUserId].membership == 'invite' }); return ( diff --git a/src/controllers/organisms/RoomList.js b/src/controllers/organisms/RoomList.js index 57c79a6b8d..dd627abaf3 100644 --- a/src/controllers/organisms/RoomList.js +++ b/src/controllers/organisms/RoomList.js @@ -63,9 +63,16 @@ module.exports = { if (room.roomId == this.props.selectedRoom) 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 var amap = this.state.activityMap; - amap[room.roomId] = 1; + amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl); this.setState({ activityMap: amap });