Don't set empty mime types on metadata.

This commit is contained in:
David Baker 2015-10-02 18:37:15 +01:00
parent 2bce4e4d62
commit 2d3b87d56d

View file

@ -53,10 +53,14 @@ function sendContentToRoom(file, roomId, matrixClient) {
body: file.name,
info: {
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();
if (file.type.indexOf('image/') == 0) {
content.msgtype = 'm.image';