How to get a list of all online users in ejabberd / xmpp?

How to get a list of all users on the Internet in XMPP, assuming that I am an administrator and XEP-133 is not working, and I am not on their list?

+4
source share
1 answer

Most of the commands in XEP-133 do work fine with ejabberd.

You are really right about some teams that don't work, including getting online users. I found that there are non-standard alternatives specific to ejabberd:

If you run disco#items on the host, you will get some interesting items that you can request:

 <iq to="localhost" type="get" id="123"> <query xmlns='http://jabber.org/protocol/disco#items' /> </iq> <iq from="localhost" type="result" to=" admin@localhost /jarnas" id="123"> <query xmlns="http://jabber.org/protocol/disco#items"> <item jid="conference.localhost" /> <item jid="pubsub.localhost" /> <item jid="riot.localhost" /> <item jid="vjud.localhost" /> <item node="announce" name="Announcements" jid="localhost" /> <item node="config" name="Configuration" jid="localhost" /> <item node="user" name="User Management" jid="localhost" /> <item node="online users" name="Online Users" jid="localhost" /> <item node="all users" name="All Users" jid="localhost" /> <item node="outgoing s2s" name="Outgoing s2s Connections" jid="localhost" /> <item node="running nodes" name="Running Nodes" jid="localhost" /> <item node="stopped nodes" name="Stopped Nodes" jid="localhost" /> </query> </iq> 

Now in your case you need "Online Users", therefore:

 <iq to="localhost" type="get" id="234"> <query xmlns='http://jabber.org/protocol/disco#items' node="online users"/> </iq> <iq from="localhost" type="result" to=" admin@localhost /jarnas" id="234" > <query xmlns="http://jabber.org/protocol/disco#items" node="online users" > <item name=" admin@localhost " jid=" admin@localhost /auto-CdB67NUOie" /> <item name=" admin@localhost " jid=" admin@localhost /jarnas" /> </query> </iq> 

will work like a charm;)

+3
source

Source: https://habr.com/ru/post/1400297/


All Articles