From 0e8bd59d2f2937ce7e43e98c0f4038cb7df35811 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 11 May 2020 15:43:34 +0100 Subject: [PATCH] View Source should target the replacing event rather than the root one Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/context_menus/MessageContextMenu.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 452489aa65..70ab80e6cc 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -130,22 +130,24 @@ export default createReactClass({ }, onViewSourceClick: function() { + const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent; const ViewSource = sdk.getComponent('structures.ViewSource'); Modal.createTrackedDialog('View Event Source', '', ViewSource, { - roomId: this.props.mxEvent.getRoomId(), - eventId: this.props.mxEvent.getId(), - content: this.props.mxEvent.event, + roomId: ev.getRoomId(), + eventId: ev.getId(), + content: ev.event, }, 'mx_Dialog_viewsource'); this.closeMenu(); }, onViewClearSourceClick: function() { + const ev = this.props.mxEvent.replacingEvent() || this.props.mxEvent; const ViewSource = sdk.getComponent('structures.ViewSource'); Modal.createTrackedDialog('View Clear Event Source', '', ViewSource, { - roomId: this.props.mxEvent.getRoomId(), - eventId: this.props.mxEvent.getId(), + roomId: ev.getRoomId(), + eventId: ev.getId(), // FIXME: _clearEvent is private - content: this.props.mxEvent._clearEvent, + content: ev._clearEvent, }, 'mx_Dialog_viewsource'); this.closeMenu(); },