Skip to content

Commit 1a8a472

Browse files
committed
Enable guest access. Show r/w icons on room directory.
1 parent d263537 commit 1a8a472

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,30 @@ module.exports = React.createClass({
8787
});
8888
var rows = [];
8989
var self = this;
90+
var guestRead, guestJoin;
9091
for (var i = 0; i < rooms.length; i++) {
9192
var name = rooms[i].name || rooms[i].aliases[0];
93+
guestRead = null;
94+
guestJoin = null;
95+
96+
if (rooms[i].world_readable) {
97+
guestRead = (
98+
<img src="img/members.svg"
99+
alt="World Readable" title="World Readable" width="12" height="12" />
100+
);
101+
}
102+
if (rooms[i].guest_can_join) {
103+
guestJoin = (
104+
<img src="img/leave.svg"
105+
alt="Guests can join" title="Guests can join" width="12" height="12" />
106+
);
107+
}
108+
92109
// <img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/>
93110
rows.unshift(
94111
<tbody key={ rooms[i].room_id }>
95112
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id)}>
96-
<td className="mx_RoomDirectory_name">{ name }</td>
113+
<td className="mx_RoomDirectory_name">{ name } {guestRead} {guestJoin}</td>
97114
<td>{ rooms[i].aliases[0] }</td>
98115
<td>{ rooms[i].num_joined_members }</td>
99116
</tr>

‎src/vector/index.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ function loadApp() {
154154
registrationUrl={makeRegistrationUrl()}
155155
ConferenceHandler={VectorConferenceHandler}
156156
config={configJson}
157-
startingQueryParams={parseQsFromFragment(window.location)} />,
157+
startingQueryParams={parseQsFromFragment(window.location)}
158+
enableGuest={true} />,
158159
document.getElementById('matrixchat')
159160
);
160161
}

0 commit comments

Comments
 (0)