Question

Anyone know why a Message formatted in 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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top