From 28c4a648becc2146f5079e794d2d16d9b7b31946 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 21 Sep 2015 16:31:31 +0100 Subject: [PATCH] Port roomlist fixes --- src/controllers/organisms/RoomList.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/controllers/organisms/RoomList.js b/src/controllers/organisms/RoomList.js index 12941d65d5..be502e3b88 100644 --- a/src/controllers/organisms/RoomList.js +++ b/src/controllers/organisms/RoomList.js @@ -71,13 +71,11 @@ module.exports = { if (actions && actions.tweaks && actions.tweaks.highlight) { hl = 2; } - if (actions.notify) { - // obviously this won't deep copy but this shouldn't be necessary - var amap = this.state.activityMap; - amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl); + // obviously this won't deep copy but this shouldn't be necessary + var amap = this.state.activityMap; + amap[room.roomId] = Math.max(amap[room.roomId] || 0, hl); - newState.activityMap = amap; - } + newState.activityMap = amap; } this.setState(newState); }, @@ -94,7 +92,12 @@ module.exports = { }, getRoomList: function() { - return RoomListSorter.mostRecentActivityFirst(MatrixClientPeg.get().getRooms()); + return RoomListSorter.mostRecentActivityFirst( + MatrixClientPeg.get().getRooms().filter(function(room) { + var member = room.getMember(MatrixClientPeg.get().credentials.userId); + return member && (member.membership == "join" || member.membership == "invite"); + }) + ); }, makeRoomTiles: function() { @@ -114,4 +117,3 @@ module.exports = { }); }, }; -