如何获取ejabberd/XMPP中所有在线用户的列表?

问题描述:

假设我是管理员并且XEP-133不起作用,并且我不在他们的名单中,我如何获得XMPP中所有在线用户的列表?如何获取ejabberd/XMPP中所有在线用户的列表?

在大多数命令XEP-133 做工精细与ejabberd。

你确实是正确的对没有工作,包括获取在线用户的一些特殊的命令:我发现虽然有不规范的替代具体到ejabberd:

如果你得到一些有趣的主机上运行disco#items项目可以查询:

<iq to="localhost" type="get" id="123"> 
    <query xmlns='http://jabber.org/protocol/disco#items' /> 
</iq> 


<iq from="localhost" type="result" to="[email protected]/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> 

现在你如果你需要 “在线用户”,所以:

<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="[email protected]/jarnas" id="234" > 
    <query xmlns="http://jabber.org/protocol/disco#items" node="online users" > 
     <item name="[email protected]" jid="[email protected]/auto-CdB67NUOie" /> 
     <item name="[email protected]" jid="[email protected]/jarnas" /> 
    </query> 
</iq> 

会像魅力一样工作;)

+0

ggozad,请参阅https://support.process-one.net/browse/EJAB-325 – user766987 2012-03-07 23:33:14

+0

嗯,承诺明天将它调查。该票是旧的,我至少肯定你可以得到注册用户的名单,因为我在一个项目中做。将会回来! – ggozad 2012-03-07 23:37:18

+0

会真的很感激! :)不幸的是我的项目必须使用PHP :(这是由于周六:(:(一直努力工作了一个多星期了) – user766987 2012-03-07 23:59:40