UrlImagePreview: Add `jabber:x:oob` element to outgoing messages
UrlImagePreview works great when receiving messages that end with ".jpg" but unfortunately sent image links are not displayed inline in other clients.
For example when I send link to image such as: https://example.com/image.jpg
It looks like that in XML console:
<message xmlns="jabber:client" to="juliet@example.com" type="chat" id="1b82bf02-6c7s4-4ce6-ac65-6aa6ad339a50">
<body>https://example.com/image.jpg</body>
</message>
But if it looked like that instead then a lot of other XMPP clients could display image inline (such as Conversations.im):
<message xmlns="jabber:client" to="juliet@example.com" type="chat" id="1b82bf02-6c7s4-4ce6-ac65-6aa6ad339a50">
<body>https://example.com/image.jpg</body>
<x xmlns="jabber:x:oob">
<url>https://example.com/image.jpg</url>
</x>
</message>
The only difference is the x
element that would be appended to all "image-like" links.
I don't know if that should be implemented as part of UrlImagePreview but it looks like a nice place to put.
I could contribute a patch if you think that's a good idea.