On 6.5 Request for room elements 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
The MAY implementation returns a list of existing users if this information is publicly available , or does not return a list at all if this information remains confidential (primary focus)
if the room is public, 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.
source share