[jdev] seeking help with presence strategy

Philipp Hancke fippo at goodadvice.pages.de
Wed Nov 25 16:41:24 UTC 2015

Am 25.11.2015 um 07:55 schrieb Daniel Dormont:
> Hi,
> 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?

Create a MUC room for every screen and join / leave it as appropriate. 
Then display the room roster in place of the users roster you currently 
have. Much easier :-)

More information about the JDev mailing list