Skip to content
Snippets Groups Projects
Commit 2d3b87d5 authored by David Baker's avatar David Baker
Browse files

Don't set empty mime types on metadata.

parent 2bce4e4d
Branches
Tags
No related merge requests found
...@@ -53,10 +53,14 @@ function sendContentToRoom(file, roomId, matrixClient) { ...@@ -53,10 +53,14 @@ function sendContentToRoom(file, roomId, matrixClient) {
body: file.name, body: file.name,
info: { info: {
size: file.size, size: file.size,
mimetype: file.type
} }
}; };
// if we have a mime type for the file, add it to the message metadata
if (file.type) {
content.info.mimetype = file.type;
}
var def = q.defer(); var def = q.defer();
if (file.type.indexOf('image/') == 0) { if (file.type.indexOf('image/') == 0) {
content.msgtype = 'm.image'; content.msgtype = 'm.image';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment