0
votes

I'm developing a cross-platform application and which incoorperates XMPP (ejabberd). How can I share presence among resources?

Please consider the following scenario:

User A is logged onto three devices: PC, Android and iOS. User A, using Android, sets his presence to 'away'. How can I set (synchronise) the other resources to 'away' (and send out presence stanzas)?

I'm looking to solve this problem using the XMPP protocol / ejabberd server; not by adding logic to the clients.

1
How do you want the user to be able to go back from "away" to "available"? From only the client that set the user to away, or from all?xnyhps
So if User A sets 'away' on Android, he can set back to 'online' from iOS. So, from all devices (/resources), yes.r712m

1 Answers

2
votes

You do not really need to synchronise presence among your resource. What you need is a display rules from your other clients.

For example, if a user has three different resources you may decide:

  • To display the most available resource of the three.
  • To display the most recent one.
  • To display the one with the highest priority.

So, you do not net to synchronize them as you will lose precision. Simply define your presence display rules, based on the goal of your client application.