python smoothxmpp & gchat 发送“隐形”在场
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您距离正确设置隐形还差一点。发送“不可用”后,您需要在 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.