开发者

XMPP HTML Message sends to Pidgin but fails to send to Jitsi

开发者 https://www.devze.com 2023-04-05 17:08 出处:网络
Anyone know why a Message formatted i开发者_开发百科n this way would send properly via XMPP to users running Pidgin but fail to send at all to users running Jitsi? There is no error message to accompa

Anyone know why a Message formatted i开发者_开发百科n this way would send properly via XMPP to users running Pidgin but fail to send at all to users running Jitsi? There is no error message to accompany the failure.

<message to="fancy.pants@thesrv0001">
    <html xmlns="http://jabber.org/protocol/xhtml-im">
    <body xmlns="http://www.w3.org/1999/xhtml">
    <a href="http://www.google.com/">link test</a>
    </body>
    </html>
</message>

I'm also interested in alternative ways of constructing an HTML Message, maybe one of them will work for Jitsi. Thanks, all!


Not all clients implement XEP-0071 (XHTML-IM), so it recommends both trying to figure out if the other side speaks XHTML (see section 10), and also mandates the use of a normal body element:

<message>
  <body>hi!</body>
  <html xmlns='http://jabber.org/protocol/xhtml-im'>
    <body xmlns='http://www.w3.org/1999/xhtml'>
      <p style='font-weight:bold'>hi!</p>
    </body>
  </html>
</message>

It's likely that Jitsi doesn't implement XEP-0071, but it should be able to pick up the plain text version.

NOTE: When you're receiving an XHTML IM, make SURE you've read the security considerations. If you're not careful to filter out all of the elements, attributes, and styles that are not explicitly allowed, a sender can attack you quite easily.

0

精彩评论

暂无评论...
验证码 换一张
取 消