This commit is contained in:
Jaiwanth 2021-08-14 00:14:57 +05:30
parent 5c78acfca4
commit 3efa699b88
7 changed files with 23 additions and 22 deletions

View file

@ -86,6 +86,7 @@ export default class MAudioBody extends React.PureComponent<IBodyProps, IState>
if (this.props.forExport) {
const content = this.props.mxEvent.getContent();
// During export, the content url will point to the MSC, which will later point to a local url
const contentUrl = content.file?.url || content.url;
return (
<span className="mx_MAudioBody">

View file

@ -213,6 +213,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
if (this.props.forExport) {
const content = this.props.mxEvent.getContent();
// During export, the content url will point to the MSC, which will later point to a local url
return <span className="mx_MFileBody">
<a href={content.file?.url || content.url}>
{ placeholder }

View file

@ -164,7 +164,8 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
protected getContentUrl(): string {
const content: IMediaEventContent = this.props.mxEvent.getContent();
if (this.props.forExport) return content.url || content.file.url;
// During export, the content url will point to the MSC, which will later point to a local url
if (this.props.forExport) return content.url || content.file?.url;
if (this.media.isEncrypted) {
return this.state.decryptedUrl;
} else {

View file

@ -78,6 +78,7 @@ export default class MVideoBody extends React.PureComponent<IBodyProps, IState>
private getContentUrl(): string|null {
const content = this.props.mxEvent.getContent<IMediaEventContent>();
// During export, the content url will point to the MSC, which will later point to a local url
if (this.props.forExport) return content.file?.url || content.url;
const media = mediaFromContent(content);
if (media.isEncrypted) {