有没有办法使用 ejabberd 服务器获取 MUC 房间的所有昵称?

我正在尝试:

<iq from='[email protected]/desktop'
  id='member3'
  to='[email protected]'
  type='get'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
   <item affiliation='member'/>
  </query>
</iq>

但我只获得没有昵称的 jid:
<iq from='[email protected]'
  id='member3'
  to='[email protected]/desktop'
  type='result'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
    <item affiliation='member'
      jid='[email protected]'
      role='participant'/>
  </query>
</iq>

最佳答案

6.5 Querying for Room Items 上从 XEP 0045 发送

<iq from='$user-name@$user-server/$user-resorce'
    id='someid'
    to='$chat-room-to-query@$chatserver'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

你有以下描述



如果房间是公共(public)的,你会得到
<iq from='$chat-room-to-query@$chatserver'
    id='someid'
    to='$user-name@$user-server/$user-resorce'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#items'>
    <item jid='$chat-room-to-query@$chatserver/$firstnick'/>
    <item jid='$chat-room-to-query@$chatserver/$secondnick'/>
    <...>
  </query>
</iq>

据我所知,ejabberd 正确地实现了这一点。

关于xmpp - 获取MUC Room的成员(member)昵称,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17145899/

10-13 03:45