3

I am developing a XMPP application and will be doing a global shared roster so that I don't have to do presence subscription requests. I also need to get the presence of a certain range of JabberIDs and not the entire global roster. We do not want to do single directed presence stanzas, since that would require up to 15 presence calls each page load. Is there a method within XMPP for me to get presence of multiple, but specific JIDs at once?

Something like:

<presence from="user1@domain.tld,user2@domain.tld,user3@domain.tld" to="user4@domain.tld" />

Thanks in advance!

Mike Sherov
  • 13,277
  • 8
  • 41
  • 62
  • Would love to have something like this, though unfortunately i don't think XMPP will allow you to do this in a straight forward manner. You will have to go ahead and hack the server side implementation of pushing presence stanza's for this to work as desired. Your case is very similar to facebook home page, which i can keep refreshing at will and expect facebook chat to display online buddy in my list. And does facebook update availability status of my buddy on every refresh??, indeed not. You might want to invest on the same lines for a scalable implementation. – Abhinav Singh Apr 17 '11 at 07:19

1 Answers1

0

You could create a pubsub node where each item is about a user. The id would be the users bare JID, and the contents could be a dataform stating whether they are online or not.

A bot or xmpp module listens out for presence messages and then updates the pubsub node appropriately.

The clients can then query the pubsub node using whatever method they like: subscribe and get live updates, or query and use requests

Theozaurus
  • 955
  • 1
  • 8
  • 21