Natives Rework (Thank you Essem)
Co-authored-by: Essem <TheEssem@users.noreply.github.com>
This commit is contained in:
parent
b424b2f813
commit
ff7f0a3110
88 changed files with 3358 additions and 3104 deletions
|
@ -99,11 +99,15 @@ export default async function (matrixClient, event, room, toStartOfTimeline) {
|
|||
} else {
|
||||
const mxcUri = await matrixClient.uploadContent(result.contents);
|
||||
// TODO: make info object get width, height, and mime from natives so i dont need to read the buffer
|
||||
const imgsize = sizeOf(result.contents)
|
||||
let mime = imgsize.type;
|
||||
if (mime == "jpg") {
|
||||
mime = "jpeg";
|
||||
// const imgsize = sizeOf(result.contents)
|
||||
const mime = result.type;
|
||||
const imgsize = {
|
||||
width: result.width,
|
||||
height: result.height
|
||||
}
|
||||
// if (mime === "jpg") {
|
||||
// mime = "jpeg";
|
||||
// }
|
||||
await matrixClient.sendImageMessage(event.event.room_id, mxcUri.content_uri, {h: imgsize.height, w: imgsize.width, mimetype: `image/${mime}`, size: result.contents.length, thumbnail_info: {h: imgsize.height, w: imgsize.width, mimetype: `image/${mime}`, size: result.contents.length}}, result.name)
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue