Skip to content

Commit ad6a19a

Browse files
committed
Merge pull request element-hq#668 from vector-im/matthew/roompreview
Support non-guest peeking
2 parents 37e8a35 + 3e8c6a4 commit ad6a19a

7 files changed

Lines changed: 107 additions & 50 deletions

File tree

‎src/components/structures/RoomDirectory.js‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ module.exports = React.createClass({
7272
joinOrPeekPromise.done(function() {
7373
dis.dispatch({
7474
action: 'view_room',
75+
auto_peek: false, // don't peek as we've already peeked here (if it was needed)
7576
room_id: roomId
7677
});
7778
}, function(err) {
@@ -97,7 +98,7 @@ module.exports = React.createClass({
9798
});
9899
var rows = [];
99100
var self = this;
100-
var guestRead, guestJoin;
101+
var guestRead, guestJoin, perms;
101102
for (var i = 0; i < rooms.length; i++) {
102103
var name = rooms[i].name || rooms[i].aliases[0];
103104
guestRead = null;
@@ -106,30 +107,37 @@ module.exports = React.createClass({
106107

107108
if (rooms[i].world_readable) {
108109
guestRead = (
109-
<img src="img/members.svg"
110-
alt="World Readable" title="World Readable" width="12" height="12" />
110+
<span>[world readable]</span>
111111
);
112-
if (MatrixClientPeg.get().isGuest() && !rooms[i].guest_can_join) {
112+
// <img src="img/members.svg"
113+
// alt="World Readable" title="World Readable" width="12" height="12" />
114+
if (rooms[i].world_readable) {
113115
shouldPeek = true;
114116
}
115117
}
116118
if (rooms[i].guest_can_join) {
117119
guestJoin = (
118-
<img src="img/leave.svg"
119-
alt="Guests can join" title="Guests can join" width="12" height="12" />
120+
<span>[guests allowed]</span>
120121
);
122+
// <img src="img/leave.svg"
123+
// alt="Guests can join" title="Guests can join" width="12" height="12" />
124+
}
125+
126+
perms = null;
127+
if (guestRead || guestJoin) {
128+
perms = <div>{guestRead} {guestJoin}</div>;
121129
}
122130

123131
// <img src={ MatrixClientPeg.get().getAvatarUrlForRoom(rooms[i].room_id, 40, 40, "crop") } width="40" height="40" alt=""/>
124132
rows.unshift(
125133
<tbody key={ rooms[i].room_id }>
126134
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id, shouldPeek)}>
127-
<td className="mx_RoomDirectory_name">{ name } {guestRead} {guestJoin}</td>
135+
<td className="mx_RoomDirectory_name">{ name }</td>
128136
<td>{ rooms[i].aliases[0] }</td>
129137
<td>{ rooms[i].num_joined_members }</td>
130138
</tr>
131-
<tr>
132-
<td className="mx_RoomDirectory_topic" colSpan="3">{ rooms[i].topic }</td>
139+
<tr onClick={self.joinRoom.bind(null, rooms[i].room_id, shouldPeek)}>
140+
<td className="mx_RoomDirectory_topic" colSpan="3">{perms} { rooms[i].topic }</td>
133141
</tr>
134142
</tbody>
135143
);

‎src/components/views/settings/Notifications.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var VectorPushRulesDefinitions = {
7575
// Messages just sent to the user in a 1:1 room
7676
"im.vector.rule.room_one_to_one": {
7777
hsDefaultRuleId: ".m.rule.room_one_to_one",
78-
description: "Messages just sent to me",
78+
description: "Messages in one-to-one chats",
7979
conditions: [{
8080
"is": "2",
8181
"kind": "room_member_count"
@@ -97,7 +97,7 @@ var VectorPushRulesDefinitions = {
9797

9898
// Messages just sent to a group chat room
9999
"im.vector.rule.room_group": {
100-
description: "Messages sent to group",
100+
description: "Messages in group chats",
101101
conditions: [{
102102
"is": ">2",
103103
"kind": "room_member_count"

src/skins/vector/css/matrix-react-sdk/views/rooms/MemberTile.css renamed to src/skins/vector/css/matrix-react-sdk/views/rooms/EntityTile.css

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
.mx_MemberTile {
17+
.mx_EntityTile {
1818
display: table-row;
1919
position: relative;
2020
color: #454545;
2121
cursor: pointer;
2222
}
2323

24-
.mx_MemberTile_avatar {
24+
.mx_EntityTile_invite {
25+
display: table-cell;
26+
vertical-align: middle;
27+
margin-left: 10px;
28+
}
29+
30+
.mx_EntityTile:hover .mx_MessageTimestamp {
31+
display: block;
32+
}
33+
34+
.mx_EntityTile_avatar {
2535
display: table-cell;
2636
padding-left: 3px;
2737
padding-right: 12px;
@@ -33,66 +43,44 @@ limitations under the License.
3343
position: relative;
3444
}
3545

36-
.mx_MemberTile_power {
37-
position: absolute;
38-
width: 16px;
39-
height: 17px;
40-
top: 0px;
41-
right: 6px;
42-
}
43-
44-
.mx_MemberTile_name {
46+
.mx_EntityTile_name {
4547
display: table-cell;
4648
vertical-align: middle;
4749
overflow: hidden;
4850
text-overflow: ellipsis;
4951
}
5052

51-
.mx_MemberTile_details {
53+
.mx_EntityTile_details {
5254
display: table-cell;
5355
padding-right: 14px;
5456
vertical-align: middle;
5557
}
5658

57-
.mx_MemberTile_userId {
59+
.mx_EntityTile_name_hover {
5860
font-size: 13px;
5961
overflow: hidden;
6062
text-overflow: ellipsis;
6163
}
6264

63-
.mx_MemberTile_chevron {
65+
.mx_EntityTile_chevron {
6466
margin-top: 8px;
6567
margin-right: -4px;
6668
margin-left: 6px;
6769
float: right;
6870
}
6971

70-
/*
71-
.mx_MemberTile_nameWrapper {
72-
display: table-cell;
73-
vertical-align: middle;
74-
overflow: hidden;
75-
text-overflow: ellipsis;
76-
}
77-
78-
.mx_MemberTile_nameSpan {
79-
}
80-
*/
81-
82-
.mx_MemberTile_unavailable .mx_MemberTile_avatar,
83-
.mx_MemberTile_unavailable .mx_MemberTile_name,
84-
.mx_MemberTile_unavailable .mx_MemberTile_userId
72+
.mx_EntityTile_unavailable .mx_EntityTile_avatar,
73+
.mx_EntityTile_unavailable .mx_EntityTile_name,
74+
.mx_EntityTile_unavailable .mx_EntityTile_name_hover
8575
{
8676
opacity: 0.66;
8777
}
8878

89-
.mx_MemberTile_offline .mx_MemberTile_avatar,
90-
.mx_MemberTile_offline .mx_MemberTile_name,
91-
.mx_MemberTile_offline .mx_MemberTile_userId
79+
.mx_EntityTile_offline .mx_EntityTile_avatar,
80+
.mx_EntityTile_offline .mx_EntityTile_name,
81+
.mx_EntityTile_offline .mx_EntityTile_name_hover
9282
{
9383
opacity: 0.25;
9484
}
9585

96-
.mx_MemberTile:hover .mx_MessageTimestamp {
97-
display: block;
98-
}
86+

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ limitations under the License.
1616

1717
/* add 20px to the height of the header when editing */
1818
.mx_RoomHeader_editing {
19-
-webit-flex: 0 0 103px ! important;
20-
flex: 0 0 103px ! important;
19+
-webit-flex: 0 0 93px ! important;
20+
flex: 0 0 93px ! important;
2121
}
2222

2323
.mx_RoomHeader_wrapper {

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

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,40 @@ limitations under the License.
1616

1717
.mx_RoomPreviewBar {
1818
text-align: center;
19+
height: 176px;
20+
21+
-webkit-align-items: center;
22+
align-items: center;
23+
24+
flex-direction: column;
25+
-webkit-flex-direction: column;
26+
27+
justify-content: center;
28+
-webkit-justify-content: center;
29+
30+
display: -webkit-box;
31+
display: -moz-box;
32+
display: -ms-flexbox;
33+
display: -webkit-flex;
34+
display: flex;
1935
}
2036

21-
.mx_RoomPreviewBar_preview_text {
22-
color: #a4a4a4;
37+
.mx_RoomPreviewBar_wrapper {
38+
}
39+
40+
.mx_RoomPreviewBar_invite_text {
41+
color: #454545;
2342
}
2443

2544
.mx_RoomPreviewBar_join_text {
2645
color: #ff0064;
2746
}
2847

48+
.mx_RoomPreviewBar_preview_text {
49+
margin-top: 25px;
50+
color: #a4a4a4;
51+
}
52+
2953
.mx_RoomPreviewBar_join_text a {
3054
text-decoration: underline;
3155
cursor: pointer;

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,22 @@ limitations under the License.
5959
}
6060
*/
6161

62+
.mx_RoomSettings .mx_RoomSettings_toggles label {
63+
margin-bottom: 10px;
64+
display: block;
65+
}
66+
67+
.mx_RoomSettings .mx_RoomSettings_toggles input[type="checkbox"] {
68+
margin-right: 7px;
69+
}
70+
6271
.mx_RoomSettings .mx_RoomSettings_tags input[type="checkbox"] {
6372
margin-left: 1em;
73+
margin-right: 7px;
74+
}
75+
76+
.mx_RoomSettings .mx_RoomSettings_tags {
77+
margin-bottom: 10px;
6478
}
6579

6680
.mx_RoomSettings .mx_RoomSettings_roomColor {
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
Copyright 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_SearchableEntityList_list {
18+
border-bottom: 1px solid #e1dddd;
19+
}
20+
21+
.mx_SearchableEntityList_list:empty {
22+
border-bottom: 0px;
23+
}

0 commit comments

Comments
 (0)