SYWEB-136: Send m.images according to the spec.

pull/16/head
Kegan Dougal 2014-11-04 11:26:03 +00:00
parent 1ac1cd6c14
commit f7cf978f68
2 changed files with 6 additions and 4 deletions

View File

@ -64,7 +64,8 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
var imageMessage = {
msgtype: "m.image",
url: undefined,
body: {
body: "Image",
info: {
size: undefined,
w: undefined,
h: undefined,
@ -90,7 +91,7 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
function(url) {
// Update message metadata
imageMessage.url = url;
imageMessage.body = {
imageMessage.info = {
size: imageFile.size,
w: size.width,
h: size.height,
@ -101,7 +102,7 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
// reuse the original image info for thumbnail data
if (!imageMessage.thumbnail_url) {
imageMessage.thumbnail_url = imageMessage.url;
imageMessage.thumbnail_info = imageMessage.body;
imageMessage.thumbnail_info = imageMessage.info;
}
// We are done

View File

@ -422,7 +422,8 @@ angular.module('matrixService', [])
var content = {
msgtype: "m.image",
url: image_url,
body: image_body
info: image_body,
body: "Image"
};
return this.sendMessage(room_id, msg_id, content);