feat: edit button on View Source dialog

reuse component SendCustomEvent
swap it in place in the View Source dialog
the Back button takes you to the View Source dialog, not the DevTools dialog
do not display the flip toggle box for changing between State Event and Normal Event
This commit is contained in:
Panagiotis 2021-03-04 23:17:29 +02:00
parent 725162ee00
commit af5cfff51d
3 changed files with 152 additions and 49 deletions

View file

@ -130,20 +130,10 @@ export default class MessageContextMenu extends React.Component {
roomId: ev.getRoomId(),
eventId: ev.getId(),
content: ev.event,
event: ev,
isEncrypted: this.props.mxEvent.getType() !== this.props.mxEvent.getWireType(),
decryptedContent: ev._clearEvent,
}, 'mx_Dialog_viewsource');
this.closeMenu();
};
onViewClearSourceClick = () => {
const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent;
const ViewSource = sdk.getComponent('structures.ViewSource');
Modal.createTrackedDialog('View Clear Event Source', '', ViewSource, {
roomId: ev.getRoomId(),
eventId: ev.getId(),
// FIXME: _clearEvent is private
content: ev._clearEvent,
decryptedContent: ev._clearEvent,
}, 'mx_Dialog_viewsource');
this.closeMenu();
};