From e43174c636281206a906067b86a31ab734bf7bec Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 13 Jan 2020 14:49:23 +0000 Subject: [PATCH 1/5] Show padlock in room headers for invite-only rooms Fixes #11832 --- res/css/views/rooms/_RoomHeader.scss | 21 +++++++++++++++++++++ src/components/views/rooms/RoomHeader.js | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/res/css/views/rooms/_RoomHeader.scss b/res/css/views/rooms/_RoomHeader.scss index f1e4456cc1..5915fb9408 100644 --- a/res/css/views/rooms/_RoomHeader.scss +++ b/res/css/views/rooms/_RoomHeader.scss @@ -263,3 +263,24 @@ limitations under the License. .mx_RoomHeader_pinsIndicatorUnread { background-color: $pinned-unread-color; } + +.mx_RoomHeader_PrivateIcon.mx_RoomHeader_isPrivate { + width: 12px; + height: 12px; + position: relative; + display: block !important; + + &::before { + background-color: $roomtile-name-color; + mask-image: url('$(res)/img/feather-customised/lock-solid.svg'); + mask-position: center; + mask-repeat: no-repeat; + mask-size: contain; + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + } +} \ No newline at end of file diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index eaf2e733ca..dda3be5a0c 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -159,6 +159,10 @@ module.exports = createReactClass({ : undefined; + const joinRules = this.props.room && this.props.room.currentState.getStateEvents("m.room.join_rules", ""); + const joinRule = joinRules && joinRules.getContent().join_rule; + const joinRuleClass = "mx_RoomHeader_PrivateIcon" + (joinRule === "invite" ? " mx_RoomHeader_isPrivate" : ""); + if (this.props.onCancelClick) { cancelButton = ; } @@ -303,6 +307,7 @@ module.exports = createReactClass({
{ roomAvatar }
{ e2eIcon } +
{ name } { topicElement } { cancelButton } From 0bd2ecd79847091007f88f129122ac753bec5687 Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 13 Jan 2020 14:51:10 +0000 Subject: [PATCH 2/5] lint --- src/components/views/rooms/RoomHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index dda3be5a0c..c55ab48159 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -307,7 +307,7 @@ module.exports = createReactClass({
{ roomAvatar }
{ e2eIcon } -
+
{ name } { topicElement } { cancelButton } From a56bf5398dfdecd58739397bf60fc85e655ac2fd Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 13 Jan 2020 14:54:39 +0000 Subject: [PATCH 3/5] lint --- res/css/views/rooms/_RoomHeader.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/css/views/rooms/_RoomHeader.scss b/res/css/views/rooms/_RoomHeader.scss index 5915fb9408..45b9733faa 100644 --- a/res/css/views/rooms/_RoomHeader.scss +++ b/res/css/views/rooms/_RoomHeader.scss @@ -283,4 +283,4 @@ limitations under the License. left: 0; right: 0; } -} \ No newline at end of file +} From 397637d59dd26ab810201b69cc0b267f63f7d3c1 Mon Sep 17 00:00:00 2001 From: Zoe Date: Mon, 13 Jan 2020 15:07:34 +0000 Subject: [PATCH 4/5] used classnames module --- src/components/views/rooms/RoomHeader.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index c55ab48159..76c85ea54b 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -161,7 +161,8 @@ module.exports = createReactClass({ const joinRules = this.props.room && this.props.room.currentState.getStateEvents("m.room.join_rules", ""); const joinRule = joinRules && joinRules.getContent().join_rule; - const joinRuleClass = "mx_RoomHeader_PrivateIcon" + (joinRule === "invite" ? " mx_RoomHeader_isPrivate" : ""); + const joinRuleClass = classNames("mx_RoomHeader_PrivateIcon", + {"mx_RoomHeader_isPrivate": joinRule === "invite"}); if (this.props.onCancelClick) { cancelButton = ; From f617fb7bbec66ec2d474f1d4c7e8ba7efa3f8440 Mon Sep 17 00:00:00 2001 From: Zoe Date: Tue, 14 Jan 2020 10:31:01 +0000 Subject: [PATCH 5/5] Place RoomHeader privacy padlocks behind the crosssigning feature flag --- src/components/views/rooms/RoomHeader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index 76c85ea54b..6807cc98a8 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -163,6 +163,9 @@ module.exports = createReactClass({ const joinRule = joinRules && joinRules.getContent().join_rule; const joinRuleClass = classNames("mx_RoomHeader_PrivateIcon", {"mx_RoomHeader_isPrivate": joinRule === "invite"}); + const privateIcon = SettingsStore.isFeatureEnabled("feature_cross_signing") ? +
: + undefined; if (this.props.onCancelClick) { cancelButton = ; @@ -308,7 +311,7 @@ module.exports = createReactClass({
{ roomAvatar }
{ e2eIcon } -
+ { privateIcon } { name } { topicElement } { cancelButton }