Skip to content

Commit 68f846e

Browse files
committed
Merge branch 'develop' into matthew/roomsettings2
2 parents ad434cb + 7232659 commit 68f846e

7 files changed

Lines changed: 90 additions & 9 deletions

File tree

‎config.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"default_hs_url": "https://matrix.org",
2+
"default_hs_url": "http://localhost:8008",
33
"default_is_url": "https://vector.im"
44
}

‎src/components/structures/RoomDirectory.js‎

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,27 @@ module.exports = React.createClass({
5656
});
5757
},
5858

59-
joinRoom: function(roomId) {
59+
joinRoom: function(roomId, shouldPeek) {
6060
var self = this;
6161
self.setState({ loading: true });
62-
// XXX: check that JS SDK suppresses duplicate attempts to join the same room
63-
MatrixClientPeg.get().joinRoom(roomId).done(function() {
62+
63+
var joinOrPeekPromise;
64+
65+
if (shouldPeek) {
66+
joinOrPeekPromise = MatrixClientPeg.get().peekInRoom(roomId);
67+
}
68+
else {
69+
joinOrPeekPromise = MatrixClientPeg.get().joinRoom(roomId);
70+
}
71+
72+
joinOrPeekPromise.done(function() {
6473
dis.dispatch({
6574
action: 'view_room',
6675
room_id: roomId
6776
});
6877
}, function(err) {
6978
console.error("Failed to join room: %s", JSON.stringify(err));
79+
console.error(err);
7080
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
7181
Modal.createDialog(ErrorDialog, {
7282
title: "Failed to join room",
@@ -87,13 +97,34 @@ module.exports = React.createClass({
8797
});
8898
var rows = [];
8999
var self = this;
100+
var guestRead, guestJoin;
90101
for (var i = 0; i < rooms.length; i++) {
91102
var name = rooms[i].name || rooms[i].aliases[0];
103+
guestRead = null;
104+
guestJoin = null;
105+
var shouldPeek = false;
106+
107+
if (rooms[i].world_readable) {
108+
guestRead = (
109+
<img src="img/members.svg"
110+
alt="World Readable" title="World Readable" width="12" height="12" />
111+
);
112+
if (MatrixClientPeg.get().isGuest() && !rooms[i].guest_can_join) {
113+
shouldPeek = true;
114+
}
115+
}
116+
if (rooms[i].guest_can_join) {
117+
guestJoin = (
118+
<img src="img/leave.svg"
119+
alt="Guests can join" title="Guests can join" width="12" height="12" />
120+
);
121+
}
122+
92123
// <img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/>
93124
rows.unshift(
94125
<tbody key={ rooms[i].room_id }>
95-
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id)}>
96-
<td className="mx_RoomDirectory_name">{ name }</td>
126+
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id, shouldPeek)}>
127+
<td className="mx_RoomDirectory_name">{ name } {guestRead} {guestJoin}</td>
97128
<td>{ rooms[i].aliases[0] }</td>
98129
<td>{ rooms[i].num_joined_members }</td>
99130
</tr>

‎src/skins/vector/css/matrix-react-sdk/structures/RoomView.css‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,17 @@ limitations under the License.
164164
margin-bottom: 12px;
165165
}
166166

167+
li.mx_RoomView_myReadMarker_container {
168+
height: 0px;
169+
margin: 0px;
170+
padding: 0px;
171+
border: 0px;
172+
}
173+
167174
hr.mx_RoomView_myReadMarker {
168175
border-top: solid 1px #76cfa6;
169-
border-bottom: none;
176+
border-bottom: solid 1px #76cfa6;
177+
margin-top: 0px;
170178
}
171179

172180
.mx_RoomView_statusArea {

‎src/skins/vector/css/matrix-react-sdk/structures/login/Login.css‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ limitations under the License.
105105
color: #4a4a4a;
106106
}
107107

108+
.mx_Login_forgot {
109+
font-size: 13px;
110+
opacity: 0.8;
111+
}
112+
113+
.mx_Login_forgot:link {
114+
color: #4a4a4a;
115+
}
116+
108117
.mx_Login_loader {
109118
position: absolute;
110119
left: 50%;

‎src/skins/vector/css/matrix-react-sdk/views/rooms/EventTile.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ limitations under the License.
135135
z-index: 1;
136136
position: relative;
137137
width: 90px;
138+
height: 1px; /* Hack to stop the height of this pushing the messages apart. Replaces marigin-top: -6px. This interacts better with a read marker being in between. Content overflows. */
138139
margin-right: 10px;
139-
margin-top: -6px;
140140
}
141141

142142
.mx_EventTile .mx_MessageTimestamp {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
Copyright 2015, 2016 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_RoomPreviewBar {
18+
text-align: center;
19+
}
20+
21+
.mx_RoomPreviewBar_preview_text {
22+
color: #a4a4a4;
23+
}
24+
25+
.mx_RoomPreviewBar_join_text {
26+
color: #ff0064;
27+
}
28+
29+
.mx_RoomPreviewBar_join_text a {
30+
text-decoration: underline;
31+
cursor: pointer;
32+
}

‎src/vector/index.js‎

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

0 commit comments

Comments
 (0)