diff --git a/src/customisations/models/IMediaEventContent.ts b/src/customisations/models/IMediaEventContent.ts index 899d03f02d5..d911a7cc3c1 100644 --- a/src/customisations/models/IMediaEventContent.ts +++ b/src/customisations/models/IMediaEventContent.ts @@ -47,6 +47,7 @@ export interface IMediaEventInfo { export interface IMediaEventContent { body?: string; + filename?: string; // `m.file` optional field url?: string; // required on unencrypted media file?: IEncryptedFile; // required for *encrypted* media info?: IMediaEventInfo; diff --git a/src/utils/MediaEventHelper.ts b/src/utils/MediaEventHelper.ts index 80487eecc1f..8f9aff48ecc 100644 --- a/src/utils/MediaEventHelper.ts +++ b/src/utils/MediaEventHelper.ts @@ -47,7 +47,9 @@ export class MediaEventHelper implements IDestroyable { } public get fileName(): string { - return this.event.getContent().body || "download"; + return this.event.getContent().filename + || this.event.getContent().body + || "download"; } public destroy() {