mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
use isEncrypted, edit state events
This commit is contained in:
parent
df52ec28d6
commit
9287e8dfa4
@ -51,7 +51,7 @@ export default class ViewSource extends React.Component {
|
|||||||
// returns the dialog body for viewing the event source
|
// returns the dialog body for viewing the event source
|
||||||
viewSourceContent() {
|
viewSourceContent() {
|
||||||
const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit
|
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 decryptedEventSource = mxEvent._clearEvent; // FIXME: _clearEvent is private
|
||||||
const originalEventSource = mxEvent.event;
|
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
|
// returns the id of the initial message, not the id of the previous edit
|
||||||
getBaseEventId() {
|
getBaseEventId() {
|
||||||
const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit
|
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;
|
const baseMxEvent = this.props.mxEvent;
|
||||||
|
|
||||||
if (isEncrypted) {
|
if (isEncrypted) {
|
||||||
@ -163,7 +163,7 @@ export default class ViewSource extends React.Component {
|
|||||||
const isEditing = this.state.isEditing;
|
const isEditing = this.state.isEditing;
|
||||||
const roomId = mxEvent.getRoomId();
|
const roomId = mxEvent.getRoomId();
|
||||||
const eventId = mxEvent.getId();
|
const eventId = mxEvent.getId();
|
||||||
const canEdit = canEditContent(this.props.mxEvent);
|
const canEdit = canEditContent(this.props.mxEvent) || mxEvent.isState();
|
||||||
return (
|
return (
|
||||||
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("View Source")}>
|
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("View Source")}>
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
Reference in New Issue
Block a user