Respect filename field on m.file events (#8951)
This commit is contained in:
@@ -47,6 +47,7 @@ export interface IMediaEventInfo {
|
|||||||
|
|
||||||
export interface IMediaEventContent {
|
export interface IMediaEventContent {
|
||||||
body?: string;
|
body?: string;
|
||||||
|
filename?: string; // `m.file` optional field
|
||||||
url?: string; // required on unencrypted media
|
url?: string; // required on unencrypted media
|
||||||
file?: IEncryptedFile; // required for *encrypted* media
|
file?: IEncryptedFile; // required for *encrypted* media
|
||||||
info?: IMediaEventInfo;
|
info?: IMediaEventInfo;
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ export class MediaEventHelper implements IDestroyable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get fileName(): string {
|
public get fileName(): string {
|
||||||
return this.event.getContent<IMediaEventContent>().body || "download";
|
return this.event.getContent<IMediaEventContent>().filename
|
||||||
|
|| this.event.getContent<IMediaEventContent>().body
|
||||||
|
|| "download";
|
||||||
}
|
}
|
||||||
|
|
||||||
public destroy() {
|
public destroy() {
|
||||||
|
|||||||
Reference in New Issue
Block a user