匿名用户如何与 Jabber (Ejabberd) 上的有效用户交换状态信息

发布于 2024-08-16 04:53:02 字数 300 浏览 3 评论 0原文

我正在开发一个社交网络,该网络应该允许成员与网站上的访问者聊天。这个概念很简单。

  1. 已注册的用户将获得自己的名册帐户
  2. 当访问者来到社交网络的主页时,他可以看到社区的一些在线成员
  3. 现在他应该能够通过单击他们的名字。

我已经让成员与他们的名册伙伴聊天。我的问题是,如何让匿名用户与会员聊天并与他交换状态信息?

我已经成功地创建了匿名帐户、会员帐户,甚至从匿名用户向其他会员发送消息。但我无法从匿名用户获取会员的状态信息,反之亦然?

顺便说一句,聊天是基于 JS 的。

I am working on a social network that should allow members to chat with visitors on the site. The concept is simple.

  1. Users who have registered signup get their own account with rosters
  2. When a visitor comes to the home page of the social network, he can see some of the online members of the community
  3. Now he should be able to initiate a chat with them, by clicking on their name.

I have already got members to chat with their roster mates. My question is, how can I get an anonymous user to chat with a member and exchange presence info with him?

I have successfully managed to create anonymous accounts, members accounts and even send messages from an anonymous user to other members. But I cant get presence information from anonymous-user to member or vice versa?

BTW, the chat is JS based.

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

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

发布评论

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

评论(1

雾里花 2024-08-23 04:53:02

您正试图打破 XMPP 模型。 Presence 是一个基于选择加入权限的系统。你问我是否能看到我的存在,我说可以。一般来说,我的客户会自动询问您是否可以看到您的存在,您的客户会说可以。这就是名册的内容——对在线订阅请求的“是”和“否”。

可以创建匿名聊天室(MUC,多用户聊天),并在其中进行展示。但这不是一个名单。这是最接近您所描述的内容,而无需进入 pubsub 的疯狂领域,我不知道您是否可以将该工具弯曲得足够远以拥有匿名名册条目。

You're trying to break the XMPP model. Presence is an opt-in permission based system. You ask me if you can see my presence, I say yes. Generally my client will then automatically ask you if I can see your presence, and your client says yes. That's what the roster is -- yes's and no's to presence subscription requests.

You can make chat rooms (MUC, multi user chat) that are anonymous, as well as do presence in them. It's not a roster, though. It's the closest to what you're describing without going into crazy-land with pubsub, and I don't know if you could even bend that tool far enough to have anonymous roster entries.

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