[jdev] seeking help with presence strategy

Daniel Dormont dan at greywallsoftware.com
Wed Nov 25 15:55:05 UTC 2015


I have an XMPP-enabled web application. In that I have several screens
where a user may see a list of names of several other users. I would
like that user to be able to see, in near-real time, basic presence
information for all of those names.

Right now I've implemented that by sending presence subscriptions to
all the names on the list minus those that are already on the current
user's roster. Then I've configured my client on the other end to
automatically and silently accept all presence subscriptions.

This works, but it seems a bit heavy-handed. In particular, it means
that the user will continue to get presence updates for everyone whose
name has ever popped up on one of these screens, whereas I only really
care about the screen they're on right now, which will typically have
no more than, say, 30 or so names.

One idea I had was to keep the approach I have but periodically drop
contacts from the roster who haven't been accessed in a while. But
that data isn't there anywhere in the roster-related information that
I can see (I use ejabberd). So I'd have to modify the server to
incorporate that.

Does this seem like a crazy idea? How else might I approach this problem?


More information about the JDev mailing list