No linkfication of XHTML message
tweet.im is an example of a service that sends it's messages with XHTML formatting, but does not wrap URLs that are potentially contained in those messages in anchor tags. I.e., the message may look something like:
\<message from="twitter.tweet.im" to="my@jid" type="chat">
\<body>Username: foobar http://example.org\</body>
\<html xmlns="http://jabber.org/protocol/xhtml-im">
\<body xmlns="http://www.w3.org/1999/xhtml">
\<div>
\<img src="http://s3.amazonaws.com/twitter_production/profile_images/012345657/twit_pic_normal.PNG"/> \<a href="http://twitter.com/Username">Username\</a>: foobar http://example.org\</div>
\</body>
\</html>
\<x xmlns="jabber:x:delay" from="twitter.tweet.im" stamp="20090526T00:07:09"/>
\</message>
Because Gajim doesn't linkify does URLs either, they appear non-clickable in the client.
Now, it maybe be argued that this is the job of the sender. But on the other hand, Gajim already handles // and __ markup for XHTML text (in htmltextview.py:handle_specials()). Wouldn't it make sense to link URLs as well?
In fact, it seems somewhat strange to me that XHTML and normal text are handled completely separately (conversation_textview.py:print_real_text branches() into either detect_and_print_special_text() or htmltextview.py:display_html()).
Wouldn't it make much for sense to convert the incoming message into HTML formatted text internally in either case, and use htmltextview to display it?
This would solve the issue while DRYing the code somewhat.