mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 10:03:47 +01:00
SYWEB-136: Send m.images according to the spec.
This commit is contained in:
parent
1ac1cd6c14
commit
f7cf978f68
2 changed files with 6 additions and 4 deletions
|
@ -64,7 +64,8 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
|
||||||
var imageMessage = {
|
var imageMessage = {
|
||||||
msgtype: "m.image",
|
msgtype: "m.image",
|
||||||
url: undefined,
|
url: undefined,
|
||||||
body: {
|
body: "Image",
|
||||||
|
info: {
|
||||||
size: undefined,
|
size: undefined,
|
||||||
w: undefined,
|
w: undefined,
|
||||||
h: undefined,
|
h: undefined,
|
||||||
|
@ -90,7 +91,7 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
|
||||||
function(url) {
|
function(url) {
|
||||||
// Update message metadata
|
// Update message metadata
|
||||||
imageMessage.url = url;
|
imageMessage.url = url;
|
||||||
imageMessage.body = {
|
imageMessage.info = {
|
||||||
size: imageFile.size,
|
size: imageFile.size,
|
||||||
w: size.width,
|
w: size.width,
|
||||||
h: size.height,
|
h: size.height,
|
||||||
|
@ -101,7 +102,7 @@ angular.module('mFileUpload', ['matrixService', 'mUtilities'])
|
||||||
// reuse the original image info for thumbnail data
|
// reuse the original image info for thumbnail data
|
||||||
if (!imageMessage.thumbnail_url) {
|
if (!imageMessage.thumbnail_url) {
|
||||||
imageMessage.thumbnail_url = imageMessage.url;
|
imageMessage.thumbnail_url = imageMessage.url;
|
||||||
imageMessage.thumbnail_info = imageMessage.body;
|
imageMessage.thumbnail_info = imageMessage.info;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are done
|
// We are done
|
||||||
|
|
|
@ -422,7 +422,8 @@ angular.module('matrixService', [])
|
||||||
var content = {
|
var content = {
|
||||||
msgtype: "m.image",
|
msgtype: "m.image",
|
||||||
url: image_url,
|
url: image_url,
|
||||||
body: image_body
|
info: image_body,
|
||||||
|
body: "Image"
|
||||||
};
|
};
|
||||||
|
|
||||||
return this.sendMessage(room_id, msg_id, content);
|
return this.sendMessage(room_id, msg_id, content);
|
||||||
|
|
Loading…
Reference in a new issue