From 158e949165982f60ca4bfa936a262252602fdf68 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 12 Feb 2019 19:10:42 +0100 Subject: [PATCH] add context menu option to show "event e2e info dialog" --- .../views/context_menus/MessageContextMenu.js | 13 +++++++++++++ src/components/views/rooms/EventTile.js | 1 + 2 files changed, 14 insertions(+) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index c990b5705d..ffa2a0bf5c 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -90,6 +90,11 @@ module.exports = React.createClass({ this.closeMenu(); }, + e2eInfoClicked: function() { + this.props.e2eInfoCallback(); + this.closeMenu(); + }, + onViewSourceClick: function() { const ViewSource = sdk.getComponent('structures.ViewSource'); Modal.createTrackedDialog('View Event Source', '', ViewSource, { @@ -332,6 +337,13 @@ module.exports = React.createClass({ ); } + let e2eInfo; + if (this.props.e2eInfoCallback) { + e2eInfo =
+ { _t('End-to-end encryption information') } +
; + } + return (
{ resendButton } @@ -347,6 +359,7 @@ module.exports = React.createClass({ { replyButton } { externalURLButton } { collapseReplyThread } + { e2eInfo }
); }, diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index ad4eae87f9..8e1fb5af9f 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -327,6 +327,7 @@ module.exports = withMatrixClient(React.createClass({ top: y, eventTileOps: tile && tile.getEventTileOps ? tile.getEventTileOps() : undefined, collapseReplyThread: replyThread && replyThread.canCollapse() ? replyThread.collapse : undefined, + e2eInfoCallback: () => this.onCryptoClicked(), onFinished: function() { self.setState({menu: false}); },