diff --git a/src/components/views/messages/MAudioBody.js b/src/components/views/messages/MAudioBody.js
index 53aa013503..2c3eba8cb3 100644
--- a/src/components/views/messages/MAudioBody.js
+++ b/src/components/views/messages/MAudioBody.js
@@ -95,7 +95,7 @@ export default class MAudioBody extends React.Component {
);
}
- if (content.file !== undefined && this.state.decryptedUrl === null) {
+ if (!this.props.mediaSrc && content.file !== undefined && this.state.decryptedUrl === null) {
// Need to decrypt the attachment
// The attachment is decrypted in componentDidMount.
// For now add an img tag with a 16x16 spinner.
diff --git a/src/components/views/messages/MFileBody.js b/src/components/views/messages/MFileBody.js
index 53d37d73da..19b8d7342b 100644
--- a/src/components/views/messages/MFileBody.js
+++ b/src/components/views/messages/MFileBody.js
@@ -104,6 +104,7 @@ export default class MFileBody extends React.Component {
showGenericPlaceholder: PropTypes.bool,
/* to set source to local file path during export */
mediaSrc: PropTypes.string,
+ isExporting: PropTypes.bool,
};
static defaultProps = {
@@ -174,7 +175,9 @@ export default class MFileBody extends React.Component {
if (this.props.showGenericPlaceholder) {
placeholder = (
-
+
+ {this.props.isExporting ? : null}
+
{this.presentableTextForFile(content, false)}
);
diff --git a/src/components/views/messages/MImageBody.js b/src/components/views/messages/MImageBody.js
index 9937624a0e..56cc6a5eec 100644
--- a/src/components/views/messages/MImageBody.js
+++ b/src/components/views/messages/MImageBody.js
@@ -370,9 +370,9 @@ export default class MImageBody extends React.Component {
let gifLabel = null;
// e2e image hasn't been decrypted yet
- if (content.file !== undefined && this.state.decryptedUrl === null) {
+ if (!this.props.mediaSrc && content.file !== undefined && this.state.decryptedUrl === null) {
placeholder = ;
- } else if (!this.state.imgLoaded) {
+ } else if (!this.props.mediaSrc && !this.state.imgLoaded) {
// Deliberately, getSpinner is left unimplemented here, MStickerBody overides
placeholder = this.getPlaceholder();
}
@@ -407,7 +407,7 @@ export default class MImageBody extends React.Component {
{ /* Calculate aspect ratio, using %padding will size _container correctly */ }
- { !this.props.mediaSrc && showPlaceholder &&
+ {showPlaceholder &&
{
}
// Important: If we aren't autoplaying and we haven't decrypted it yet, show a video with a poster.
- if (content.file !== undefined && this.state.decryptedUrl === null && autoplay) {
+ if (!this.props.mediaSrc && content.file !== undefined && this.state.decryptedUrl === null && autoplay) {
// Need to decrypt the attachment
// The attachment is decrypted in componentDidMount.
// For now add an img tag with a spinner.
diff --git a/src/components/views/messages/MessageEvent.js b/src/components/views/messages/MessageEvent.js
index 84a3d56d77..e243c3c8bd 100644
--- a/src/components/views/messages/MessageEvent.js
+++ b/src/components/views/messages/MessageEvent.js
@@ -47,6 +47,9 @@ export default class MessageEvent extends React.Component {
/* to set source to local file path during export */
mediaSrc: PropTypes.string,
+ /* to set source to local file path during export */
+ isExporting: PropTypes.bool,
+
/* the maximum image height to use, if the event is an image */
maxImageHeight: PropTypes.number,
@@ -124,6 +127,7 @@ export default class MessageEvent extends React.Component {
showUrlPreview={this.props.showUrlPreview}
tileShape={this.props.tileShape}
mediaSrc={this.props.mediaSrc}
+ isExporting={this.props.isExporting}
maxImageHeight={this.props.maxImageHeight}
replacingEventId={this.props.replacingEventId}
editState={this.props.editState}
diff --git a/src/components/views/messages/RedactedBody.tsx b/src/components/views/messages/RedactedBody.tsx
index 5f80460d03..fb4f0b0efa 100644
--- a/src/components/views/messages/RedactedBody.tsx
+++ b/src/components/views/messages/RedactedBody.tsx
@@ -24,9 +24,10 @@ import SettingsStore from "../../../settings/SettingsStore";
interface IProps {
mxEvent: MatrixEvent;
+ isExporting: boolean;
}
-const RedactedBody = React.forwardRef
(({mxEvent}, ref) => {
+const RedactedBody = React.forwardRef(({mxEvent, isExporting}, ref) => {
const cli: MatrixClient = useContext(MatrixClientContext);
let text = _t("Message deleted");
@@ -44,6 +45,7 @@ const RedactedBody = React.forwardRef(({mxEvent}, ref) => {
return (
+ { isExporting ? : null }
{ text }
);
diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx
index a7bfb40ad0..302d35fcce 100644
--- a/src/components/views/rooms/EventTile.tsx
+++ b/src/components/views/rooms/EventTile.tsx
@@ -311,6 +311,7 @@ export default class EventTile extends React.Component {
static defaultProps = {
// no-op function because onHeightChanged is optional yet some sub-components assume its existence
onHeightChanged: function() {},
+ isExporting: false,
};
static contextType = MatrixClientContext;
@@ -1150,6 +1151,7 @@ export default class EventTile extends React.Component {
{ thread }