-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send images missing info #80
Comments
Yeah its a good idea, to match the way matrix do it. // from matrix-js-sdk
export interface IEncryptedFile {
url: string;
mimetype?: string;
key: {
alg: string;
key_ops: string[]; // eslint-disable-line camelcase
kty: string;
k: string;
ext: boolean;
};
iv: string;
hashes: { [alg: string]: string };
v: string;
}
type TMediaFile = {
msgtype: string;
body: string //filename, when encrypted randomized. Do not use real name.
info: {
mimetype: string;
size: number;
h: number;
w: number;
},
url: string;
file: IEncryptedFile
} |
any way to implement this i node-red function node?
but i got blank message |
Yes you are right. My testing when I created it showed that mimtype was required but the other things not so much. I'll look into automatically detecting the info. I just really don't want to add too many third party packages so I have been avoiding it. I'm hoping in a future release to deprecate the send image and file nodes for a single upload file node. If you want to update the room or profile image you need an uploaded file to the matrix server so one of the options will be to upload a file without posting it to a room to accomplish that. I'll look into parsing extra info at that time. At least you can send the data manually for now though if you know the information of the image. |
Very minor issue but when sending an image, there does not appear to be any data in content --> info. This causes an issue with most of the matrix bridges I use (mautrix) as they don't recognize the message as containing an image and just show it as a binary attachement. It seems that content --> info should contain at least mimetype.
Example message that does not work correctly via bridges, sent from node-red-contrib-matrix-chat (with sensative data removed)
{
"type": "m.room.message",
"sender": "@xxxx.com",
"content": {
"body": "Camera Snapshot",
"msgtype": "m.image",
"url": "mxc://xxx/xxxx",
"info": {}
},
"origin_server_ts": xxxxx,
"unsigned": {
"age": 75
},
"event_id": "xxxx",
"room_id": "xxxx"
}
Example message sent by the element client that works properly through (mautrix) bridges
{
"type": "m.room.message",
"sender": "@xxxx.com",
"content": {
"body": "1.jpg",
"info": {
"size": 316949,
"mimetype": "image/jpeg",
"thumbnail_info": {
"w": 635,
"h": 600,
"mimetype": "image/jpeg",
"size": 166629
},
"w": 959,
"h": 906,
"xyz.amorgan.blurhash": "xxxxx",
"thumbnail_url": "mxc://xxxx/xxxx"
},
"msgtype": "m.image",
"url": "mxc://xxxx/xxxx"
},
"origin_server_ts": xxxx,
"unsigned": {
"age": 87,
"transaction_id": "xxxx"
},
"event_id": "xxxx",
"room_id": "xxxx"
}
Again from my testing the only thing that seems to be required to make an image display correctly is :
but perhaps it's a good idea to send the rest of the info as well to more closely match the "stock" client message?
TIA!
The text was updated successfully, but these errors were encountered: