Fetching ejabberd MUC members list

老子叫甜甜 提交于 2019-12-13 08:44:28

问题


There seem to be some threads around this and it seems very obvious an issue to be a problem, but somehow in MUCs / rooms created by my ejabberd mobile clients, the creator / owner is able to fetch the members list but when I fetch the same from the members, there is an administrative privileges required error.

Below are the request and response stanzas as well as the room options. Can someone advise please if there is something I'm overlooking here ... many thanks?

Request from member:

<iq 
  type="get"
  to="1479313326166_what%20a%20day@conference.example.com" 
  id="7BB7F8C8-B47F-4C0C-9E4D-8CAC3A5287FF">
    <query xmlns="http://jabber.org/protocol/muc#admin">
      <item 
        affiliation="member">
      </item>
    </query>
</iq>

Response to member:

<iq xmlns="jabber:client" 
  from="1479313326166_what%20a%20day@conference.example.com" 
  to="group-member@example.com/9A36B83F-0B1B-484E-BFB2-C0F1C7148274" 
  id="7BB7F8C8-B47F-4C0C-9E4D-8CAC3A5287FF"
  type="error">
    <query xmlns="http://jabber.org/protocol/muc#admin">
      <item affiliation="member"></item>
    </query>
    <error code="403" type="auth">
      <forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"></forbidden>
      <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
        Administrator privileges required
      </text>
    </error>
</iq>

Room options:

> /sbin/ejabberdctl get_room_options 1479313326166_what%20a%20day conference.example.com
title   
description 
allow_change_subj   true
allow_query_users   true
allow_private_messages  true
allow_private_messages_from_visitors    anyone
allow_visitor_status    true
allow_visitor_nickchange    true
public  true
public_list true
persistent  true
moderated   true
captcha_protected   false
members_by_default  true
members_only    true
allow_user_invites  false
allow_subscription  true
password_protected  false
password    
anonymous   true
presence_broadcast  [moderator,participant,visitor]
allow_voice_requests    true
voice_request_min_interval  1800
max_users   200
logging false
vcard   <vCard xmlns='vcard-temp'><NICKNAME>What a day</NICKNAME><NOTE/></vCard>
captcha_whitelist   {0,nil}
mam false

回答1:


I tried configure a room via ConfigurationForm and ServerDefaultConfig, fortunetely never got your error and fetchMembers always works fine. There might be some very silly stuff that hard to find out. Maybe try to clear the db or restart the server to start over.

<x xmlns=\"jabber:x:data\" type=\"form\">
      <title>Configuration of room 1479231695@conference.192.168.100.226</title>
      <field type=\"hidden\" var=\"FORM_TYPE\">
        <value>http://jabber.org/protocol/muc#roomconfig</value>
      </field>
      <field type=\"text-single\" label=\"Room title\" var=\"muc#roomconfig_roomname\">
        <value></value>
      </field>
      <field type=\"text-single\" label=\"Room description\" var=\"muc#roomconfig_roomdesc\">
        <value></value>
      </field>
      <field type=\"boolean\" label=\"Make room persistent\" var=\"muc#roomconfig_persistentroom\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Make room public searchable\" var=\"muc#roomconfig_publicroom\">
        <value>0</value>
      </field>
      <field type=\"boolean\" label=\"Make participants list public\" var=\"public_list\">
        <value>0</value>
      </field>
      <field type=\"boolean\" label=\"Make room password protected\" var=\"muc#roomconfig_passwordprotectedroom\">
        <value>0</value>
      </field>
      <field type=\"text-private\" label=\"Password\" var=\"muc#roomconfig_roomsecret\">
        <value></value>
      </field>
      <field type=\"list-single\" label=\"Maximum Number of Occupants\" var=\"muc#roomconfig_maxusers\">
        <value>200</value>
        <option label=\"5\">
          <value>5</value>
        </option>
        <option label=\"10\">
          <value>10</value>
        </option>
        <option label=\"20\">
          <value>20</value>
        </option>
        <option label=\"30\">
          <value>30</value>
        </option>
        <option label=\"50\">
          <value>50</value>
        </option>
        <option label=\"100\">
          <value>100</value>
        </option>
        <option label=\"200\">
          <value>200</value>
        </option>
      </field>
      <field type=\"list-single\" label=\"Present real Jabber IDs to\" var=\"muc#roomconfig_whois\">
        <option label=\"moderators only\">
          <value>moderators</value>
        </option>
        <option label=\"anyone\">
          <value>anyone</value>
        </option>
        <value>anyone</value>
      </field>
      <field type=\"list-multi\" label=\"Roles for which Presence is Broadcasted\" var=\"muc#roomconfig_presencebroadcast\">
        <value>moderator</value>
        <value>participant</value>
        <value>visitor</value>
        <option label=\"Moderator\">
          <value>moderator</value>
        </option>
        <option label=\"Participant\">
          <value>participant</value>
        </option>
        <option label=\"Visitor\">
          <value>visitor</value>
        </option>
      </field>
      <field type=\"boolean\" label=\"Make room members-only\" var=\"muc#roomconfig_membersonly\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Make room moderated\" var=\"muc#roomconfig_moderatedroom\">
        <value>0</value>
      </field>
      <field type=\"boolean\" label=\"Default users as participants\" var=\"members_by_default\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow users to change the subject\" var=\"muc#roomconfig_changesubject\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow users to send private messages\" var=\"allow_private_messages\">
        <value>1</value>
      </field>
      <field type=\"list-single\" label=\"Allow visitors to send private messages to\" var=\"allow_private_messages_from_visitors\">
        <value>anyone</value>
        <option label=\"nobody\">
          <value>nobody</value>
        </option>
        <option label=\"moderators only\">
          <value>moderators</value>
        </option>
        <option label=\"anyone\">
          <value>anyone</value>
        </option>
      </field>
      <field type=\"boolean\" label=\"Allow users to query other users\" var=\"allow_query_users\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow users to send invites\" var=\"muc#roomconfig_allowinvites\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow visitors to send status text in presence updates\" var=\"muc#roomconfig_allowvisitorstatus\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow visitors to change nickname\" var=\"muc#roomconfig_allowvisitornickchange\">
        <value>1</value>
      </field>
      <field type=\"boolean\" label=\"Allow visitors to send voice requests\" var=\"muc#roomconfig_allowvoicerequests\">
        <value>1</value>
      </field>
      <field type=\"text-single\" label=\"Minimum interval between voice requests (in seconds)\" var=\"muc#roomconfig_voicerequestmininterval\">
        <value>1800</value>
      </field>
      <field type=\"jid-multi\" label=\"Exclude Jabber IDs from CAPTCHA challenge\" var=\"muc#roomconfig_captcha_whitelist\"></field>
    </x>

mod_muc:
    ## host: "conference.@HOST@"
    access:
      - allow
    access_admin:
      - allow: admin
    access_create: muc_create
    access_persistent: muc_create
    history_size: 0
    default_room_options:
        allow_user_invites: true
        anonymous: false
        members_by_default: true
        members_only: true
        moderated: false
        persistent: true
        public: false
        public_list: false


来源:https://stackoverflow.com/questions/40637958/fetching-ejabberd-muc-members-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!