2014-10-09 81 views
0

我使用iq方法尝试了strophe.js,并且我可以获取在线用户的数量,但我无法获取在线用户列表来自我的Openfire 3.9.3服务器。XEP-0133:管理员请求获取所有在线用户列表

XMPP请求体:

<iq from='[email protected]/7adf302e' to='[email protected]' 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="[email protected]" to="[email protected]/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

XEP-0050描述,对命令请求的错误响应item-not-found意味着“响应的JID找不到请求的命令节点”,即服务器不支持获取在线用户列表的命令。

快速浏览一下Openfire源代码,看起来好像它支持节点http://jabber.org/protocol/admin#get-active-users处的Get List of Active Users命令。它看起来像这个命令只是返回连接到服务器的用户,所以我不确定这与本例中的“get all online users”命令有什么不同。

+0

通过引用XEP-0050,我可以获得所有管理命令的列表。但是我需要执行XEP-0133中描述的更多命令。有没有办法添加更多的命令? – Pandiarajan 2014-10-09 11:23:19

+0

这取决于你使用的服务器。 – legoscia 2014-10-09 11:25:22

+0

我使用的是Openfire 3.9.3服务器。 – Pandiarajan 2014-10-09 11:47:51

相关问题