Open allilengyi opened 3 years ago
Isn't this normal for images? You can always right-click and choose save link as ..
To indicate that the link is a media share, the following should be included in the message:
<x xmlns='jabber:x:oob'>
<url>https://...</url>
</x>
The URL in this fragment should match the URL provided in the <body>
of the message. So a full message for the file https://example.com/cat.jpg
would be:
<message from='sender@xmpp.example' to='recipient@xmpp.example'>
<body>https://example.com/cat.jpg</body>
<x xmlns='jabber:x:oob'>
<url>https://example.com/cat.jpg</url>
</x>
</message>
This will trigger inline display in modern XMPP clients.
For more information see Modern XMPP: File transfer -> HTTP upload.
So I guess this issue is then a feature request to support HTTP Upload
Well it seems there is already a URL for the file, so there is no need to "upload". Just include the metadata I mentioned if you know that the URL is meant to be an inline share/attachment.
I am not a software developer. I am currently looking into the code, to see where things have to be changed.
I guess the problem is that Oobdesc
is included into the message:
https://github.com/42wim/matterbridge/blob/master/vendor/github.com/matterbridge/go-xmpp/xmpp.go#L878-L893
Ah, thanks for the link to the source. Oobdesc
is something that's ignored by most clients these days (they will insist on the message body matching the URL for various reasons, including preventing the ability to spoof URLs).
So it looks like just Ooburl
needs to be set when the message from the other protocol is a share/attachment, and the right metadata will be included :)
Ooburl
ist set https://github.com/42wim/matterbridge/blob/master/bridge/xmpp/xmpp.go#L342-L378
however, SendOOB
does not include the <body>
tag. I will see if I can modify the code und build matterbridge on my own successfully.
To solve this issue, this might be helpfull: https://salsa.debian.org/mdosch/go-sendxmpp/-/blob/master/httpupload.go It think it would be a good idea to implement native xmpp upload to fix this issue.
Describe the bug When sending an image from protocol A to xmpp then one receives a clickable link but there is no media offered to download in the client. Sure, when clicking on the link, I can view the image in the browser.
Expected behavior I expect a file offered to download in xmpp clients
Screenshots/debug logs Screenshot from XMPP client Dino
Relevant part from the matterbridge log
Environment (please complete the following information):
Additional context Might this be an issue with the apache config? Permissions? ports? I checked that file sending/receiving works with the xmpp server that is used to bridge. Matterbridge config file.