XMPP: RFC for establishing mutual subscription when the original requester is offline (subscribed presence)

we have an XMPP server (OpenFire) and a custom client based on the Java Smack XMPP stack. We use a manual subscription, so customers must exchange subscribed and signed attendances.

As noted in the RFC , the subscribed presence ("I want to subscribe to your presence") is stored on the server and resent each time the user logs in until he answers them. Unfortunately, the same is not like the answers ("signed" or "canceled"). If the original requester, if it is offline, when other users respond to the subscription request, it does not receive a response. I could not find anything in the XMPP RFC about the expected server behavior.

What can I do? Is there something I could miss? Or is there a standard way to implement this use case?

This OpenFire forum post suggests that the behavior I experience is desirable ...

Thanks for all the pointers, Florian.

+4
source share
2 answers

You have two ways to determine your subscription status:

  • Check the list of the requesting user. If the list contains an element for the object in question with the subscription attribute "to" or "both", then you are subscribed.
  • The second option is to send another subscription server to the server; the server should immediately respond with a signature on behalf of another user if they have already accepted the request for presence.
+1
source

So, Alice wants to subscribe to information about Bob's presence and sends a subscription request. The server will send notifications to Bob until he answers yes or no. And now your problem is that the server will not notify Alice if she disconnects, and Bob will respond to the request. In this way, Alice will get Bobs' answer by chance.

If Bob agrees to exchange information about the presence, Alice will notice this on her list - she will see the presence of Bobs (away, idle, ...). Otherwise, she will not know if the request has not yet been completed or if Bob rejected her request.

You can change this change by implementing and adding a custom module to your openfire server. Openfire has an API for this.

This module will respond to confirmation messages and can send a status message for all pending or recently confirmed subscription messages to the subscriber (at each login). Your client code can process these messages and provide this status to the subscriber accordingly.

0
source

Source: https://habr.com/ru/post/1334318/


All Articles