XMPP-名册订阅说明 [英] XMPP - Roster Subscription Explaination

查看:128
本文介绍了XMPP-名册订阅说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑一下,我在Jabber服务器上有2个用户Alice和Bob.要将订阅添加为both的名册,我需要执行以下步骤:

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. 爱丽丝向鲍勃发送订阅请求.

  1. Alice sends a subscription request to Bob.

Bob收到请求后,便批准了该请求.

When Bob receives the request, he approves it.

鲍勃也可能对爱丽丝的存在感兴趣,因此他订阅了爱丽丝.

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

并且爱丽丝需要批准鲍勃的请求.

And Alice needs to approve Bob's request.

但是

现在考虑,鲍勃不在服务器上,即他尚未注册,爱丽丝试图将他添加到她的花名册中.

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. 爱丽丝向鲍勃发送订阅请求.

  1. Alice sends a subscription request to Bob.

未注册的Bob没收到请求.

Bob, being unregistered, didnt receive the request.

Alice-> Bob订阅设置为None.

Alice->Bob subscription set as None.

过程到此结束.

现在,鲍勃(Bob)进行了注册.爱丽丝将如何得知鲍勃已经注册并需要再次发送subscription请求?鲍勃将如何向所有将其添加到他/她名单中的用户推送通知?哪个 XEP/Ejabberd模块处理此问题?

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?

我们调试了Whatsapp,并知道,在这种情况下,Bob向所有将其添加到名册的用户推送了一条通知.

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.

推荐答案

我认为它更像是,您在设置环境时会考虑多种方案,因此会采用哪种配置类型.我知道有几种方法可能会导致这种情况.

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. 所讨论的服务器在连接Xmpp客户端方面起着关键作用,例如Internet上的DNS服务器在互连客户端方面起着重要作用,因此如果Bob在Alice时没有注册,发送一个请求,他可能有一个缓存服务,该服务记录了所有的互连服务,当他注册后,他有了一个Xmpp服务,该服务可以自动发现网络上的对等设备(就像我说的那样,它是特定于用户的),但是必须是发现过程中涉及的某种类型的用户设置;然后,他的服务将从缓存中拉出所有过去的请求,并根据时间限制能够检索Alice的请求,然后他可以做出响应.从哲学的角度来看,这更多.但是,如果您是开发人员,则可以为上述所有情况编写插件.如果您需要更多技术参数,我们可以讨论一下,例如您要在Bobs服务器上编写的发现方法的类型,您可能要在Bobs网络上放置的缓存引擎的类型以及如何将其插入他的Jabber服务器等. ,这只是我自己的两分钱.只需考虑这种情况,类似于登录时具有数据包收集器和检索脱机消息的情况,但是在这种情况下,它将包含Jabber服务器,而数据包收集器将是您插入服务器的缓存服务引擎.

  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.

如果这是一个LAN,则要像检索主机记录和所有相互连接性问题一样动态,可能会有些困难,但是我可以建议的可行的解决方案是抢占所有可用的联系方式,或者仍然可以在特定子网中运行.

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.

这篇关于XMPP-名册订阅说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆