在<a>m or something that has the same effect, in an XMPP message using Smack

时间:2015-09-02 16:12:39

标签: java xmpp smack pidgin

I'm using the pidgin xmpp client and I want to send from java a hyperlink, I have all the code necessary to send messages, but when it comes to sending a hyperlink the only format that I can successfully send from java seems to be the raw url:

http://abc.xyz

This works fine but what I want is something more like:

Alphabet

I've tried using <a> but that just comes out in the raw format again:

<a href="http://abc.xyz">Alphabet</a>

Edit: I have written a client so I can read the raw format and it seems there are characters in the message that get escaped, notably < goes to &lt; and > goes to &gt;

1 个答案:

答案 0 :(得分:3)

要通过XMPP发送HTML格式的IM消息,您需要使用XHTML-IM发送消息。

这样做并且pidgin应该正确显示它。