简体   繁体   中英

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

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;

To send HTML formatted IM messages over XMPP you need to use XHTML-IM to send your message.

Do that and pidgin should display it correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM