[ejabberd] How to maintain a global list of online users (Django + ejabberd)

Badlop badlop at gmail.com
Thu Mar 29 01:16:50 MSK 2012

On 26 March 2012 18:34, Pankaj Singh <singh.pankaj.iitkgp08 at gmail.com> wrote:
> Hi,
> I am writing a facebook application using django with one to one chat
> feature. I am using a python script to authenticate users to ejabberd
> server  in background. Once user is connected to xmpp server, I want
> to recommend him 10 online users to chat with. But I am not able to
> come up with a nice implementation.

Check the ejabberd Guide about mod_shared_roster
and try the @online@ special member.

To satisfy your requirement, you would only need to modify the source code
to show in the roster only 10 online users, instead of all the online users.

> One method can be to store updated list of JID of all online users in
> memcached or redis and recommend from here. Here I need to update the
> list whenever some one comes online or goes offline. Is there a way to
> get JID of user after authenticating from python script ?


More information about the ejabberd mailing list