-
+ avatarElement =
;
}
@@ -1058,6 +1168,12 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
title={_t('Close')} />;
}
+ const memberDetails =
;
+
+ const isRoomEncrypted = useIsEncrypted(cli, room);
// undefined means yet to be loaded, null means failed to load, otherwise list of devices
const [devices, setDevices] = useState(undefined);
// Download device lists
@@ -1082,14 +1198,15 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
setDevices(null);
}
}
-
- _downloadDeviceList();
+ if (isRoomEncrypted) {
+ _downloadDeviceList();
+ }
// Handle being unmounted
return () => {
cancelled = true;
};
- }, [cli, user.userId]);
+ }, [cli, user.userId, isRoomEncrypted]);
// Listen to changes
useEffect(() => {
@@ -1106,21 +1223,20 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
}
};
- cli.on("deviceVerificationChanged", onDeviceVerificationChanged);
+ if (isRoomEncrypted) {
+ cli.on("deviceVerificationChanged", onDeviceVerificationChanged);
+ }
// Handle being unmounted
return () => {
cancel = true;
- cli.removeListener("deviceVerificationChanged", onDeviceVerificationChanged);
+ if (isRoomEncrypted) {
+ cli.removeListener("deviceVerificationChanged", onDeviceVerificationChanged);
+ }
};
- }, [cli, user.userId]);
-
- let devicesSection;
- const isRoomEncrypted = _enableDevices && room && cli.isRoomEncrypted(room.roomId);
- if (isRoomEncrypted) {
- devicesSection =
;
- } else {
- let text;
+ }, [cli, user.userId, isRoomEncrypted]);
+ let text;
+ if (!isRoomEncrypted) {
if (!_enableDevices) {
text = _t("This client does not support end-to-end encryption.");
} else if (room) {
@@ -1128,22 +1244,24 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
} else {
// TODO what to render for GroupMember
}
-
- if (text) {
- devicesSection = (
-
-
{ _t("Trust & Devices") }
-
- { text }
-
-
- );
- }
+ } else {
+ text = _t("Messages in this room are end-to-end encrypted.");
}
+ const devicesSection = isRoomEncrypted ?
+ (
) : null;
+ const securitySection = (
+
+
{ _t("Security") }
+
{ text }
+
verifyDevice(user.userId, null)}>{_t("Verify")}
+ { devicesSection }
+
+ );
+
let e2eIcon;
if (isRoomEncrypted && devices) {
- e2eIcon =
;
+ e2eIcon =
;
}
return (
@@ -1153,16 +1271,14 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
-
-
+
+
{ e2eIcon }
{ displayName }
-
- { user.userId }
-
-
+
{ user.userId }
+
{presenceLabel}
{statusLabel}
@@ -1176,11 +1292,9 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
}
- { devicesSection }
-
- { directChatsSection }
-
+ { securitySection }
diff --git a/src/components/views/rooms/E2EIcon.js b/src/components/views/rooms/E2EIcon.js
index 54260e4ee2..d6baa30c8e 100644
--- a/src/components/views/rooms/E2EIcon.js
+++ b/src/components/views/rooms/E2EIcon.js
@@ -36,7 +36,13 @@ export default function(props) {
_t("All devices for this user are trusted") :
_t("All devices in this encrypted room are trusted");
}
- const icon = ();
+
+ let style = null;
+ if (props.size) {
+ style = {width: `${props.size}px`, height: `${props.size}px`};
+ }
+
+ const icon = ();
if (props.onClick) {
return ({ icon });
} else {
diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js
index 22f1f914b6..5fcf1e4491 100644
--- a/src/components/views/rooms/EventTile.js
+++ b/src/components/views/rooms/EventTile.js
@@ -606,8 +606,8 @@ module.exports = createReactClass({
mx_EventTile_last: this.props.last,
mx_EventTile_contextual: this.props.contextual,
mx_EventTile_actionBarFocused: this.state.actionBarFocused,
- mx_EventTile_verified: this.state.verified === true,
- mx_EventTile_unverified: this.state.verified === false,
+ mx_EventTile_verified: !isBubbleMessage && this.state.verified === true,
+ mx_EventTile_unverified: !isBubbleMessage && this.state.verified === false,
mx_EventTile_bad: isEncryptionFailure,
mx_EventTile_emote: msgtype === 'm.emote',
mx_EventTile_redacted: isRedacted,
@@ -800,7 +800,7 @@ module.exports = createReactClass({
{ timestamp }
- { this._renderE2EPadlock() }
+ { !isBubbleMessage && this._renderE2EPadlock() }
{ thread }
{ sender }
-
+
{ timestamp }
- { this._renderE2EPadlock() }
+ { !isBubbleMessage && this._renderE2EPadlock() }
{ thread }
%(role)s in %(roomName)s": "%(role)s in %(roomName)s",
"Failed to deactivate user": "Failed to deactivate user",
"This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.",
"Messages in this room are not end-to-end encrypted.": "Messages in this room are not end-to-end encrypted.",
+ "Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.",
+ "Security": "Security",
+ "Verify": "Verify",
"Sunday": "Sunday",
"Monday": "Monday",
"Tuesday": "Tuesday",
@@ -1091,7 +1102,6 @@
"Reply": "Reply",
"Edit": "Edit",
"Message Actions": "Message Actions",
- "Options": "Options",
"Attachment": "Attachment",
"Error decrypting attachment": "Error decrypting attachment",
"Decrypt %(text)s": "Decrypt %(text)s",