I made some changes to Jitsi so that it replaces image URLs even if they don't end with an image extension (.jpg, etc.). Many image URLs on the internet don't include the image extension. Here's an example:
I don't think that just matching on extensions is an accurate way of determining whether an image replacement should take place. What I'm doing instead is pulling in the content-type for the URL, and if it matches known image content types, the image replacement happens.
Another change I made is to make the images aspect ratio correct. Currently, Jitsi just forces the images to 120x90, I think, and this ends up distorting most images that you link. Due to the HTML renderer that the chat panel uses, it looks like we have to define a specific width and height. So, I'm reading the image width and height as well as the content type, then I fix the replacement image HTML width at 320 and make the height proportional.
My friends and I feel that it's a pretty nice improvement to the experience of chatting in Jitsi. Do you think there's any chance at getting this added to Jitsi? My implementation is hacky because I had to change the image replacement regular expression to basically allow for any URL and then add in an additional check to see whether the URL has an image content-type. It's not the most efficient, either, because you end up downloading the image twice. I can submit my implementation, but I'm sure there's a more elegant solution for people who know the Jitsi codebase well. The core problem, though, is that Jitsi is currently using a regular expression to determine whether the image replacement should take place, and that just isn't enough information to really determine whether a URL is an image without grabbing the content type because image URLs can be pretty much any arbitrary URL.