From 77464c669fabafe01ffe2a105fa6ba53101df44c Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 11 Dec 2015 00:40:28 +0000 Subject: [PATCH] switch to fake tag names for fake tags, and highlight new invites --- src/components/views/rooms/RoomList.js | 27 ++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 2ff9541a07..576c5ee0cf 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -103,8 +103,11 @@ module.exports = React.createClass({ hl = 1; } + var me = room.getMember(MatrixClientPeg.get().credentials.userId); var actions = MatrixClientPeg.get().getPushActionsForEvent(ev); - if (actions && actions.tweaks && actions.tweaks.highlight) { + if ((actions && actions.tweaks && actions.tweaks.highlight) || + (me && me.membership == "invite")) + { hl = 2; } } @@ -153,17 +156,17 @@ module.exports = React.createClass({ var self = this; var s = { lists: {} }; - s.lists["m.invite"] = []; + s.lists["im.vector.fake.invite"] = []; s.lists["m.favourite"] = []; - s.lists["m.recent"] = []; + s.lists["im.vector.fake.recent"] = []; s.lists["m.lowpriority"] = []; - s.lists["m.archived"] = []; + s.lists["im.vector.fake.archived"] = []; MatrixClientPeg.get().getRooms().forEach(function(room) { var me = room.getMember(MatrixClientPeg.get().credentials.userId); if (me && me.membership == "invite") { - s.lists["m.invite"].push(room); + s.lists["im.vector.fake.invite"].push(room); } else { var shouldShowRoom = ( @@ -196,13 +199,13 @@ module.exports = React.createClass({ } } else { - s.lists["m.recent"].push(room); + s.lists["im.vector.fake.recent"].push(room); } } } }); - //console.log("calculated new roomLists; m.recent = " + s.lists["m.recent"]); + //console.log("calculated new roomLists; im.vector.fake.recent = " + s.lists["im.vector.fake.recent"]); // we actually apply the sorting to this when receiving the prop in RoomSubLists. @@ -235,7 +238,7 @@ module.exports = React.createClass({
{ expandButton } - - { Object.keys(self.state.lists).map(function(tagName) { - if (!tagName.match(/^m\.(invite|favourite|recent|lowpriority|archived)$/)) { + if (!tagName.match(/^(m\.(favourite|lowpriority)|im\.vector\.fake\.(invite|recent|archived))$/)) { return -