XEP-0133:管理员请求获取所有在线用户列表

时间:2014-10-09 10:29:19

标签: javascript xml xmpp openfire

我尝试使用iq方法使用strophe.js,我可以获得在线用户的数量,但是我无法从我的Openfire 3.9.3服务器获取在线用户列表。

XMPP请求正文:

<iq from='admin@localhost/7adf302e' to='admin@localhost' type='set' xml:lang='en' xmlns='jabber:client' id='6816:sendIQ'>
  <command xmlns='http://jabber.org/protocol/commands' node='http://jabber.org/protocol/admin#get-online-users-list' />
</iq>

XMPP回复

<iq xmlns="jabber:client" type="error" id="6816:sendIQ" from="admin@localhost" to="admin@localhost/7adf302e">
  <command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#get-online-users-list"/>
  <error code="404" type="cancel">
    <item-not-found xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</iq>

价: http://xmpp.org/extensions/xep-0133.html#get-online-users-list

1 个答案:

答案 0 :(得分:1)

XEP-0050中所述,对命令请求的item-not-found错误响应意味着&#34;响应的JID找不到请求的命令节点&#34;,即服务器没有&#39; t支持获取在线用户列表的命令。

从快速浏览一下Openfire源代码,它似乎支持节点http://jabber.org/protocol/admin#get-active-users上的Get List of Active Users命令。看起来这个命令只返回连接到服务器的用户,所以我不确定这是否与&#34;获取所有在线用户&#34;在这种情况下命令。