2

We want to get all fields from this link (http://xmpp.org/extensions/xep-0045.html#roomconfig) for this section

Example 165. Service Sends Configuration Form to Owner

In the specification it is showing all fields, but we are not getting all fields from ejabberd like:

<field label='Roles and Affiliations that May Retrieve Member List' type='list-multi' var='muc#roomconfig_getmemberlist'>

We want to get muc#roomconfig_getmemberlist, but it is not getting from ejabberd.

What config we need to change to get all field like above link?

Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44

1 Answers1

1

ejabberd is return all the field it supports. At the moment ejabberd does not support changing the affiliation of users allowed to retrieve the member list. It is assumed, that MUC admin, room owner and members can retrieve the member list.

That said, even if you do not have that field in the configuration form, ejabberd supports managing member list. You can retrieve the members list from a user with proper credentials, sending the following query:

<iq type="get" to="room@conference.example.net" id="aac1a">
 <query xmlns="http://jabber.org/protocol/muc#admin">
  <item affiliation="member"/>
 </query>
</iq>

You will receive a reply of the form:

<iq from="room@conference.example.net" type="result" id="aae0a">
 <query xmlns="http://jabber.org/protocol/muc#admin">
  <item affiliation="member" jid="newmember@example.net"/>
 </query>
</iq>
Mickaël Rémond
  • 9,035
  • 1
  • 24
  • 44
  • I am getting Problems when fetching the member list as a member but not an owner or admin. We are using same code as you explained above. I am receiving a "forbidden" error when I try to retrieve the member list of a members-only chatroom, even though I am a member of the chat-room. – Yogendra Gupta Aug 01 '15 at 10:50
  • 1
    You should create another specific question. I just tried on ejabberd 15.07 to send the member query packet I have shown (not owner nor admin) and it works as described. Are you sure that the MUC room is persistent ? Of course if not persistent, the membership list is emptied when the last user leave, because the room is destroyed when the last user leaves. – Mickaël Rémond Aug 02 '15 at 15:11
  • 1
    I am not saying your issue will be solved by upgrade. Just saying that it works in my test, so you may have another issue totally unrelated to your original question. That said download page for ejabberd include binary installer and packages: https://www.process-one.net/en/ejabberd/downloads/ – Mickaël Rémond Aug 03 '15 at 07:09
  • Well, you should not be using a three years old version, at least for security reason. Anyway, you can patch yourself, here is where it is implemented: https://github.com/processone/ejabberd/blob/master/src/mod_muc_room.erl#L2537 – Mickaël Rémond Aug 03 '15 at 10:43