diff --git a/res/img/e2e-pending.svg b/res/img/e2e-pending.svg new file mode 100644 index 0000000000..469611cc8d --- /dev/null +++ b/res/img/e2e-pending.svg @@ -0,0 +1,12 @@ + + + +48BF5D32-306C-4B20-88EB-24B1F743CAC9 +Created with sketchtool. + + + + + + + diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 589524bb9e..50fe0928b0 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -34,6 +34,7 @@ const ContextualMenu = require('../../structures/ContextualMenu'); import dis from '../../../dispatcher'; import {makeEventPermalink} from "../../../matrix-to"; import SettingsStore from "../../../settings/SettingsStore"; +import {EventStatus} from 'matrix-js-sdk'; const ObjectUtils = require('../../../ObjectUtils'); @@ -442,7 +443,6 @@ module.exports = withMatrixClient(React.createClass({ const ev = this.props.mxEvent; const props = {onClick: this.onCryptoClicked}; - if (ev.getContent().msgtype === 'm.bad.encrypted') { return ; } else if (ev.isEncrypted()) { @@ -451,15 +451,15 @@ module.exports = withMatrixClient(React.createClass({ } else { return ; } - } else { - // XXX: if the event is being encrypted (ie eventSendStatus === - // encrypting), it might be nice to show something other than the - // open padlock? - - // if the event is not encrypted, but it's an e2e room, show the - // open padlock - const e2eEnabled = this.props.matrixClient.isRoomEncrypted(ev.getRoomId()); - if (e2eEnabled) { + } else if (this.props.matrixClient.isRoomEncrypted(ev.getRoomId())) { + // else if room is encrypted + // and event is being encrypted or is not_sent (Unknown Devices/Network Error) + if (ev.status === EventStatus.ENCRYPTING || ev.status === EventStatus.NOT_SENT) { + // XXX: if the event is being encrypted (ie eventSendStatus === encrypting), + // it might be nice to show something other than the open padlock? + return ; + } else { + // if the event is not encrypted, but it's an e2e room, show the open padlock return ; } } @@ -736,6 +736,10 @@ function E2ePadlockUndecryptable(props) { ); } +function E2ePadlockPending(props) { + return ; +} + function E2ePadlockVerified(props) { return (