XMPP - Roster Subscription Explaination

风格不统一 提交于 2019-12-11 03:08:45

问题


Consider I've 2 users Alice and Bob on my Jabber Server. To add into the rosters with subscription as both, I need to do the following steps:

  1. Alice sends a subscription request to Bob.

  2. When Bob receives the request, he approves it.

  3. Bob may also be interested in Alice's presence, so he subscribes to her.

  4. And Alice needs to approve Bob's request.

BUT

Now consider, Bob was not on the server, i.e. he is unregistered and Alice tries to add him into her roster.

Following are the steps which will take place:

  1. Alice sends a subscription request to Bob.

  2. Bob, being unregistered, didnt receive the request.

  3. Alice->Bob subscription set as None.

  4. Process ends Here.

Now, Bob got himself registered. How would Alice get to know that Bob got himself registered and she needs to send the subscription request again OR How would Bob pushes a notification to every user who added him into his/her roster? Which XEP/Ejabberd Module handles this?

We debugged Whatsapp and got to know that, in this case, Bob pushes a notification to all those users who added him in their rosters.


回答1:


Well the way I see it's more like, which type of configuration do you employ as several scenarios come into factoring when setting up your environment. Here are a few ways I know such things might turn out.

  1. The server in question plays a key role in connecting Xmpp clients, in a situation such as the on the Internet DNS servers play a prominent role in interconnecting clients, so if Bob was not registered at the time Alice sent a request, he might have a caching service that records all interconnection service, and when he becomes registered and he has an Xmpp service that auto-discovers peers on the network(like I said this would be user specific), but there has to be some type of user setting involved in the discovery process; his service would then pull all past requests from the cache and depending on time limits be able to retrieve Alice's request and then he can respond. This is more from a philosophical perspective. But if you are a developer , you can write plugins for all the described scenario above. If you need some more technical parameters we can talk about that such as the type of discovery method you want to write on Bobs server , the type of caching engine you might want to put on Bobs network and how to plug it into his Jabber server etc, this was just my own two cents. Just consider the situation somewhat similar as having a packet collector and retrieving offline messages when you log in, but in this case it would encompass the Jabber server and the packet collector would be the caching service engine you plug in to your server.

  2. If it were a LAN, it might be a little more difficult to be as dynamic as retrieving host records and all inter-connectivity issues, but the plausible solution I can muster is to have a preemption of all available contacts, or better still operate withing a specific sub-net.



来源:https://stackoverflow.com/questions/42485797/xmpp-roster-subscription-explaination

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!