4
votes

Is there a way to get all nicknames of a MUC Room with an ejabberd server?

I'm trying with:

<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>

but I obtain only jid without nicknames:

<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>
1
I have a "members-only" room. I would discover nicknames also when members are offline.Rino Seminara

1 Answers

1
votes

On 6.5 Querying for Room Items from XEP 0045 when you send

<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> 

You have the following description

An implementation MAY return a list of existing occupants if that information is publicly available, or return no list at all if this information is kept private.(emphasis mine)

if the room is public them you get

<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>

From my knowledge ejabberd implements this correctly.