简体   繁体   English

<a>使用Smack在XMPP消息</a>中以<a>m或具有相同效果的东西</a>发送链接

[英]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: 我正在使用pidgin xmpp客户端,我想从Java发送超链接,我具有发送消息所需的所有代码,但是当涉及到发送超链接时,我可以从Java成功发送的唯一格式似乎是原始网址:

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>但这又以原始格式出现:

<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; 编辑:我已经编写了一个客户端,所以我可以阅读原始格式,并且似乎消息中的某些字符可以转义,特别是<转到&lt; and > goes to &gt; 然后>转到&gt;

To send HTML formatted IM messages over XMPP you need to use XHTML-IM to send your message. 要通过XMPP发送HTML格式的IM消息,您需要使用XHTML-IM来发送消息。

Do that and pidgin should display it correctly. 这样做,并且pidgin应该正确显示它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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