XMPP HTML 消息发送到 Pidgin,但无法发送到 Jitsi

发布于 2024-12-05 07:39:14 字数 444 浏览 2 评论 0原文

任何人都知道为什么以这种方式格式化的消息可以通过 XMPP 正确发送到运行 Pidgin 的用户,但根本无法发送到运行 Jitsi 的用户?失败时没有伴随任何错误消息。

<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>

我也对构建 HTML 消息的其他方法感兴趣,也许其中一种适用于 Jitsi。谢谢大家!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

虚拟世界 2024-12-12 07:39:14

并非所有客户端都实现 XEP-0071 (XHTML-IM),因此建议两者都尝试确定对方是否使用 XHTML(请参阅 部分10),并且还强制使用普通的 body 元素:

<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>

Jitsi 很可能没有实现 XEP-0071,但它应该能够获取纯文本版本。

注意:当您收到 XHTML IM 时,请确保您已阅读安全注意事项。如果您不小心过滤掉所有未明确允许的元素、属性和样式,发件人就可以很容易地攻击您。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文