XMPP(含咂嘴) - 添加好友好友、XMPP

2023-09-06 11:39:49 作者:执笔梦一场

在我的聊天应用程序时,我有添加好友我必须遵循这个过程 -

In my chat application when I have to add a friend I have to follow this process -

假设A-> BIST:A将发送订阅包B(服务器条目显示NONE订阅)IIND - B将订阅的数据包发送到(服务器条目将是 - 到/从)iiird - B将再次发送订阅包A(服务器条目到/从)ivth - A将认购数据包发送到B(服务器条目BOTH)

Suppose A->B ist : A will send subscribe packet to B ( server entry shows NONE subscription ) iind - B will send subscribed packet to A ( server entry will be - TO/FROM) iiird - B will again send subscribe packet to A ( server entry TO/FROM ) ivth - A will send subscribed packet to B ( server entry BOTH )

每个一个通知发送到有关用户,并允许相应的数据包被发送之后的时间。

Each time a notification is sent to the concerned user and after allowing corresponding packet is sent.

我要像这样做 -

当A发送好友请求,以B(的通知B将被发送 - 并且服务器条目应到/从)和高达B到接受或不,如果他接受它,然后立即服务器条目应该是BOTH。

When A sends a friend request to B ( a notification To B will be sent - and the server entry should be TO/FROM ) and its upto B to accept or not, If he accepts it then immediately the server entry should be BOTH.

请告诉我如何可以通过发送订阅包只有两套达到相同的。

Please tell me how can I achieve the same by sending only two sets of subscription packets.

感谢

推荐答案

据我所知,这只能在客户机/库级别上进行:你必须实现客户端,以便为每位确认订阅请求,另一个订阅请求被发送回到初始请求者

AFAIK this can only be done on the client/library level: You have to implement the client so that for every confirmed subscription request, another subscription request is send back to the initial requester.

但你将永远有4个步骤/包被以朋友送的JID。

But you will always have 4 steps/packets to be send to "friend" to JIDs.