From d6f6f32c744eb4301f1b02a4844fd8f3e1902a22 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 18 Jan 2016 17:37:13 +0000 Subject: [PATCH] WIP to support non-guest peeking, and slightly improve roomdirectory look & feel for now --- src/components/structures/RoomDirectory.js | 26 ++++++++++++------- .../views/rooms/RoomPreviewBar.css | 4 +++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index ea2a7237d..d528145ea 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -72,6 +72,7 @@ module.exports = React.createClass({ joinOrPeekPromise.done(function() { dis.dispatch({ action: 'view_room', + auto_peek: false, // don't peek as we've already peeked here (if it was needed) room_id: roomId }); }, function(err) { @@ -97,7 +98,7 @@ module.exports = React.createClass({ }); var rows = []; var self = this; - var guestRead, guestJoin; + var guestRead, guestJoin, perms; for (var i = 0; i < rooms.length; i++) { var name = rooms[i].name || rooms[i].aliases[0]; guestRead = null; @@ -106,30 +107,37 @@ module.exports = React.createClass({ if (rooms[i].world_readable) { guestRead = ( - World Readable + [world readable] ); - if (MatrixClientPeg.get().isGuest() && !rooms[i].guest_can_join) { + // World Readable + if (rooms[i].world_readable) { shouldPeek = true; } } if (rooms[i].guest_can_join) { guestJoin = ( - Guests can join + [guests allowed] ); + // Guests can join + } + + perms = null; + if (guestRead || guestJoin) { + perms =
{guestRead} {guestJoin}
; } // rows.unshift( - { name } {guestRead} {guestJoin} + { name } { rooms[i].aliases[0] } { rooms[i].num_joined_members } - - { rooms[i].topic } + + {perms} { rooms[i].topic } ); diff --git a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css index f68d70853..0e792409e 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css +++ b/src/skins/vector/css/matrix-react-sdk/views/rooms/RoomPreviewBar.css @@ -22,6 +22,10 @@ limitations under the License. color: #a4a4a4; } +.mx_RoomPreviewBar_invite_text { + color: #454545; +} + .mx_RoomPreviewBar_join_text { color: #ff0064; }