Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Remove E2eIcon onClick #3791

Merged
merged 3 commits into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion res/css/views/rooms/_EventTile.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2020 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -353,7 +354,6 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody {
left: 46px;
width: 15px;
height: 15px;
cursor: pointer;
display: block;
bottom: 0;
right: 0;
Expand Down
24 changes: 4 additions & 20 deletions src/components/views/rooms/EventTile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2017 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Copyright 2019 Michael Telatynski <[email protected]>
Copyright 2019, 2020 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,6 @@ import PropTypes from 'prop-types';
import createReactClass from 'create-react-class';
const classNames = require("classnames");
import { _t, _td } from '../../../languageHandler';
const Modal = require('../../../Modal');

const sdk = require('../../../index');
const TextForEvent = require('../../../TextForEvent');
Expand Down Expand Up @@ -443,15 +442,6 @@ module.exports = createReactClass({
});
},

onCryptoClick: function(e) {
const event = this.props.mxEvent;

Modal.createTrackedDialogAsync('Encrypted Event Dialog', '',
import('../../../async-components/views/dialogs/EncryptedEventDialog'),
{event},
);
},

onRequestKeysClick: function() {
this.setState({
// Indicate in the UI that the keys have been requested (this is expected to
Expand Down Expand Up @@ -479,19 +469,18 @@ module.exports = createReactClass({

_renderE2EPadlock: function() {
const ev = this.props.mxEvent;
const props = {onClick: this.onCryptoClick};

// event could not be decrypted
if (ev.getContent().msgtype === 'm.bad.encrypted') {
return <E2ePadlockUndecryptable {...props} />;
return <E2ePadlockUndecryptable />;
}

// event is encrypted, display padlock corresponding to whether or not it is verified
if (ev.isEncrypted()) {
if (this.state.verified) {
return; // no icon for verified
} else {
return (<E2ePadlockUnverified {...props} />);
return (<E2ePadlockUnverified />);
}
}

Expand All @@ -508,7 +497,7 @@ module.exports = createReactClass({
return; // we expect this to be unencrypted
}
// if the event is not encrypted, but it's an e2e room, show the open padlock
return <E2ePadlockUnencrypted {...props} />;
return <E2ePadlockUnencrypted />;
}

// no padlock needed
Expand Down Expand Up @@ -920,7 +909,6 @@ class E2ePadlock extends React.Component {
static propTypes = {
icon: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
onClick: PropTypes.func,
};

constructor() {
Expand All @@ -931,10 +919,6 @@ class E2ePadlock extends React.Component {
};
}

onClick = (e) => {
if (this.props.onClick) this.props.onClick(e);
};

onHoverStart = () => {
this.setState({hover: true});
};
Expand Down