Fix image uploading on Nang

Issue #82. Turns out we need to send mime "application/octet-stream" for encrypted image data. It's a little unclear why it worked for audio though.
This commit is contained in:
N-Pex 2021-03-24 16:44:29 +01:00
parent 20fcc29fbc
commit b64c3a5791

View file

@ -314,8 +314,14 @@ class Util {
messageContent.file = encryptedFile;
// Encrypted data sent as octet-stream!
opts.type = "application/octet-stream";
matrixClient.uploadContent(data, opts)
.then((response) => {
if (response.error) {
return reject(response.error);
}
encryptedFile.url = response.content_uri;
return this.sendMessage(matrixClient, roomId, "m.room.message", messageContent)
})