diff --git a/src/components/structures/ViewSource.js b/src/components/structures/ViewSource.js index 4ee70ee2a7..ddcffe4f7f 100644 --- a/src/components/structures/ViewSource.js +++ b/src/components/structures/ViewSource.js @@ -23,6 +23,7 @@ import { _t } from "../../languageHandler"; import * as sdk from "../../index"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import { SendCustomEvent } from "../views/dialogs/DevtoolsDialog"; +import { canEditContent } from "../../utils/EventUtils"; export default class ViewSource extends React.Component { static propTypes = { @@ -162,6 +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); return (
@@ -170,7 +172,7 @@ export default class ViewSource extends React.Component {
{isEditing ? this.editSourceContent() : this.viewSourceContent()}
- {!isEditing && ( + {!isEditing && canEdit && (