How can anonymous users exchange presence information with valid users on Jabber (Ejabberd)

StackOverflow https://stackoverflow.com/questions/1958763

문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top