本文介绍了获取ejabberd MUC成员列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

围绕此问题似乎有一些线索,这似乎是一个很明显的问题,但是以某种方式在我的ejabberd移动客户端创建的MUC/房间中,创建者/所有者能够获取成员列表,但是当我从成员那里获取相同信息,则出现需要管理特权的错误.

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%[email protected]"
  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%[email protected]"
  to="[email protected]/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

推荐答案

我尝试通过ConfigurationForm和ServerDefaultConfig配置一个房间,幸运的是从来没有收到您的错误,并且fetchMembers总是可以正常工作.可能有一些非常愚蠢的东西很难找到.也许尝试清除数据库或重新启动服务器以重新开始.

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 [email protected]</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

这篇关于获取ejabberd MUC成员列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 20:09