From 9287e8dfa4f55b368a3c108d3c15442cdfdc4c1c Mon Sep 17 00:00:00 2001 From: Panagiotis <27917356+panoschal@users.noreply.github.com> Date: Mon, 8 Mar 2021 22:15:34 +0200 Subject: [PATCH] use isEncrypted, edit state events --- src/components/structures/ViewSource.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/structures/ViewSource.js b/src/components/structures/ViewSource.js index ddcffe4f7f..cfe28e9f73 100644 --- a/src/components/structures/ViewSource.js +++ b/src/components/structures/ViewSource.js @@ -51,7 +51,7 @@ export default class ViewSource extends React.Component { // returns the dialog body for viewing the event source viewSourceContent() { const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit - const isEncrypted = this.props.mxEvent.getType() !== this.props.mxEvent.getWireType(); + const isEncrypted = mxEvent.isEncrypted(); const decryptedEventSource = mxEvent._clearEvent; // FIXME: _clearEvent is private const originalEventSource = mxEvent.event; @@ -85,7 +85,7 @@ export default class ViewSource extends React.Component { // returns the id of the initial message, not the id of the previous edit getBaseEventId() { const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit - const isEncrypted = this.props.mxEvent.getType() !== this.props.mxEvent.getWireType(); + const isEncrypted = mxEvent.isEncrypted(); const baseMxEvent = this.props.mxEvent; if (isEncrypted) { @@ -163,7 +163,7 @@ export default class ViewSource extends React.Component { const isEditing = this.state.isEditing; const roomId = mxEvent.getRoomId(); const eventId = mxEvent.getId(); - const canEdit = canEditContent(this.props.mxEvent); + const canEdit = canEditContent(this.props.mxEvent) || mxEvent.isState(); return (