【问题标题】:XEP-0133: Admin request to get all online users listXEP-0133:获取所有在线用户列表的管理员请求
【发布时间】:2014-12-04 05:57:10
【问题描述】:

我尝试使用 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

【问题讨论】:

    标签: javascript xml xmpp openfire


    【解决方案1】:

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

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

    【讨论】:

    • 通过引用 XEP-0050,我可以获得所有管理命令的列表。但我需要执行 XEP-0133 中描述的更多命令。有没有办法添加更多命令?。
    • 这取决于您使用的服务器。
    • 我使用的是 Openfire 3.9.3 服务器。
    • 看起来 Openfire 中有替代命令;查看更新的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多