You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Include the mimetype with the file info. Store the objectURL in state so that it can be used normally by the exising templates
Conflicts: src/ContentMessages.js src/components/views/messages/MImageBody.js
This commit is contained in:
@@ -149,7 +149,19 @@ class ContentMessages {
|
||||
dis.dispatch({action: 'upload_progress', upload: upload});
|
||||
}
|
||||
}).then(function(url) {
|
||||
content.url = url;
|
||||
if (encryptInfo === null) {
|
||||
// If the attachment isn't encrypted then include the URL directly.
|
||||
content.url = url;
|
||||
} else {
|
||||
// If the attachment is encrypted then bundle the URL along
|
||||
// with the information needed to decrypt the attachment and
|
||||
// add it under a file key.
|
||||
encryptInfo.url = url;
|
||||
if (file.type) {
|
||||
encryptInfo.mimetype = file.type;
|
||||
}
|
||||
content.file = encryptInfo;
|
||||
}
|
||||
return matrixClient.sendMessage(roomId, content);
|
||||
}, function(err) {
|
||||
error = err;
|
||||
|
||||
Reference in New Issue
Block a user