From 41fb3e742e006615a4e91d0e0c4c3b4e51dc38b5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 13 Nov 2020 19:13:35 +0100 Subject: [PATCH] fix file upload attachment api changes --- src/domain/session/room/RoomViewModel.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 83fcca3a..a979be09 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -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() {