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:
parent
20fcc29fbc
commit
b64c3a5791
1 changed files with 6 additions and 0 deletions
|
|
@ -314,8 +314,14 @@ class Util {
|
||||||
|
|
||||||
messageContent.file = encryptedFile;
|
messageContent.file = encryptedFile;
|
||||||
|
|
||||||
|
// Encrypted data sent as octet-stream!
|
||||||
|
opts.type = "application/octet-stream";
|
||||||
|
|
||||||
matrixClient.uploadContent(data, opts)
|
matrixClient.uploadContent(data, opts)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
if (response.error) {
|
||||||
|
return reject(response.error);
|
||||||
|
}
|
||||||
encryptedFile.url = response.content_uri;
|
encryptedFile.url = response.content_uri;
|
||||||
return this.sendMessage(matrixClient, roomId, "m.room.message", messageContent)
|
return this.sendMessage(matrixClient, roomId, "m.room.message", messageContent)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue