From 2f345401c4a9d270d585693b55d4dad4aadefba8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 12 Feb 2019 18:43:28 +0100 Subject: [PATCH] show unknown devices dialog when clicking e2e warning in room header --- src/components/views/rooms/E2EIcon.js | 5 ++++- src/components/views/rooms/RoomHeader.js | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/E2EIcon.js b/src/components/views/rooms/E2EIcon.js index 30891e84b7..b421bcfb5f 100644 --- a/src/components/views/rooms/E2EIcon.js +++ b/src/components/views/rooms/E2EIcon.js @@ -16,6 +16,7 @@ limitations under the License. import classNames from 'classnames'; import { _t } from '../../../languageHandler'; +import AccessibleButton from '../elements/AccessibleButton'; export default function(props) { const isWarning = props.status === "warning"; @@ -35,5 +36,7 @@ export default function(props) { _t("All devices for this user are trusted") : _t("All devices in this encrypted room are trusted"); } - return (
); + return ( +
+ ); } diff --git a/src/components/views/rooms/RoomHeader.js b/src/components/views/rooms/RoomHeader.js index e25b25d110..6e5ccab7f9 100644 --- a/src/components/views/rooms/RoomHeader.js +++ b/src/components/views/rooms/RoomHeader.js @@ -32,6 +32,7 @@ import {CancelButton} from './SimpleRoomHeader'; import SettingsStore from "../../../settings/SettingsStore"; import RoomHeaderButtons from '../right_panel/RoomHeaderButtons'; import E2EIcon from './E2EIcon'; +import * as cryptodevices from '../../../cryptodevices'; module.exports = React.createClass({ displayName: 'RoomHeader', @@ -145,6 +146,12 @@ module.exports = React.createClass({ return !(currentPinEvent.getContent().pinned && currentPinEvent.getContent().pinned.length <= 0); }, + _onShowDevicesClick: function() { + if (this.props.e2eStatus === "warning") { + cryptodevices.showUnknownDeviceDialogForMessages(MatrixClientPeg.get(), this.props.room); + } + }, + render: function() { const RoomAvatar = sdk.getComponent("avatars.RoomAvatar"); const TintableSvg = sdk.getComponent("elements.TintableSvg"); @@ -156,7 +163,7 @@ module.exports = React.createClass({ let pinnedEventsButton = null; const e2eIcon = this.props.e2eStatus ? - : + : undefined; if (this.props.onCancelClick) {