python smoothxmpp & gchat 发送“隐形”在场

发布于 2024-10-03 10:22:36 字数 184 浏览 0 评论 0原文

我正在使用 python smoothxmpp 库对 gchat 进行一些工作,我的问题是:如何发送状态节,以便其他人将我视为隐形(但仍然登录并能够发送/接收状态/消息?所以到目前为止,我已经尝试过 self.sendPresence(ppriority = "0", ptype="unavailable") 但这似乎阻止了我接收其他用户存在节的能力。

I am using the python sleekxmpp library to do some work with gchat, my question is: how do I send a presence stanza so that other people see me as invisible (but still be logged on and able to send/receive presencce/messages? So far I have tried self.sendPresence(ppriority = "0", ptype="unavailable") but that seems to stop my ability to receive other users presence stanzas.

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

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

发布评论

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

评论(1

眉黛浅 2024-10-10 10:22:36

您距离正确设置隐形还差一点。发送“不可用”后,您需要在 jabber:iq:privacy 节中发送更多数据,如 中所述XEP-0126 隐形。曾几何时,大多数客户使用 XEP-0018 Invisible Presence,但随着 XMPP 变得更加明确人们认识到,这种方法虽然更简单,但非常不标准。

问题是你已经告诉服务器你确实不可用,而不仅仅是偷偷地这样。

You're stopping a bit short of properly setting up invisibility. After you send "unavailable" you need to send more data in jabber:iq:privacy stanzas, as described in XEP-0126 Invisibility. Once upon a time most clients used XEP-0018 Invisible Presence, but as XMPP became more defined it was realized that that method, though easier, was very non-standard.

The problem is you've told the server you really are unavailable, not just sneakily so.

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