fix file upload attachment api changes

This commit is contained in:
Bruno Windels 2020-11-13 19:13:35 +01:00
parent 0292725076
commit 41fb3e742e

View file

@ -172,12 +172,14 @@ export class RoomViewModel extends ViewModel {
} catch (err) {
return;
}
const attachment = this._room.uploadAttachment(file.blob, file.name);
const content = {
body: file.name,
msgtype: "m.file",
msgtype: "m.file"
};
await this._room.sendEvent("m.room.message", content, attachment);
await this._room.sendEvent("m.room.message", content, {
"url": this._room.createAttachment(file.blob, file.name)
});
// TODO: dispose file.blob (in the attachment, after upload)
}
get composerViewModel() {