diff --git a/src/components/structures/ViewSource.js b/src/components/structures/ViewSource.js
index b762ad3fca..be9be4db81 100644
--- a/src/components/structures/ViewSource.js
+++ b/src/components/structures/ViewSource.js
@@ -16,65 +16,176 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
-import React from 'react';
-import PropTypes from 'prop-types';
-import SyntaxHighlight from '../views/elements/SyntaxHighlight';
-import {_t} from "../../languageHandler";
+import React from "react";
+import PropTypes from "prop-types";
+import SyntaxHighlight from "../views/elements/SyntaxHighlight";
+import { _t } from "../../languageHandler";
import * as sdk from "../../index";
-import {replaceableComponent} from "../../utils/replaceableComponent";
-
+import MatrixClientContext from "../../contexts/MatrixClientContext";
+import { SendCustomEvent } from "../views/dialogs/DevtoolsDialog";
+import { canEditContent } from "../../utils/EventUtils";
+import { MatrixClientPeg } from '../../MatrixClientPeg';
+import { replaceableComponent } from "../../utils/replaceableComponent";
@replaceableComponent("structures.ViewSource")
export default class ViewSource extends React.Component {
static propTypes = {
- content: PropTypes.object.isRequired,
onFinished: PropTypes.func.isRequired,
- roomId: PropTypes.string.isRequired,
- eventId: PropTypes.string.isRequired,
- isEncrypted: PropTypes.bool.isRequired,
- decryptedContent: PropTypes.object,
+ mxEvent: PropTypes.object.isRequired, // the MatrixEvent associated with the context menu
};
- render() {
- const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
+ constructor(props) {
+ super(props);
- let content;
- if (this.props.isEncrypted) {
- content = <>
-
- {_t("Decrypted event source")}
-
-
- {_t("Original event source")}
-
-
+ {_t("Decrypted event source")}
+
+
+ {_t("Original event source")}
+
+