匿名用户如何与 Jabber (Ejabberd) 上的有效用户交换状态信息
我正在开发一个社交网络,该网络应该允许成员与网站上的访问者聊天。这个概念很简单。
- 已注册的用户将获得自己的名册帐户
- 当访问者来到社交网络的主页时,他可以看到社区的一些在线成员
- 现在他应该能够通过单击他们的名字。
我已经让成员与他们的名册伙伴聊天。我的问题是,如何让匿名用户与会员聊天并与他交换状态信息?
我已经成功地创建了匿名帐户、会员帐户,甚至从匿名用户向其他会员发送消息。但我无法从匿名用户获取会员的状态信息,反之亦然?
顺便说一句,聊天是基于 JS 的。
I am working on a social network that should allow members to chat with visitors on the site. The concept is simple.
- Users who have registered signup get their own account with rosters
- When a visitor comes to the home page of the social network, he can see some of the online members of the community
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正试图打破 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.