我试图从我的 XMPP 客户端与 Ejabberd 通信创建一个 MUC 房间。
这是我的 Ejabberd muc 配置:
mod_muc:
## host: "conference.@HOST@"
access: muc
access_create: muc_create
access_persistent: mud_create
access_admin: muc_admin
db_type: odbc
max_user_conferences: 100
default_room_options:
mam: true
public: false
public_list: false
allow_change_subj: false
allow_user_invites: false
members_only: false
members_by_default: false
anonymous: false
allow_private_messages: true
persistent: true
这是我从客户端获得的 muc 功能:
<iq xmlns='jabber:client' from='conference.my.domain.com' to='my_id@my.domain.com/null' id='iqid1:sendIQ' type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='conference' type='text' name='Chatrooms'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<feature var='http://jabber.org/protocol/disco#items'/>
<feature var='http://jabber.org/protocol/muc'/>
<feature var='http://jabber.org/protocol/muc#unique'/>
<feature var='jabber:iq:register'/>
<feature var='http://jabber.org/protocol/rsm'/>
<feature var='vcard-temp'/>
<feature var='urn:xmpp:mam:tmp'/>
<feature var='urn:xmpp:mam:0'/>
<feature var='urn:xmpp:mam:1'/>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/network/serverinfo</value>
</field>
</x>
</query>
</iq>
当我尝试从客户端创建一个 MUC 房间时:
<presence from='my_id@my.domain.com/null' to='new_room_id@conference.my.domain.com/my_nickname' xmlns='jabber:client'>
<x xmlns='http://jabber.org/protocol/muc'/>
</presence>
我得到了一个新房间创建的响应:
<presence xmlns='jabber:client' from='new_room_id@conference.my.domain.com/my_nickname' to='my_id@my.domain.com/null'>
<x xmlns='http://jabber.org/protocol/muc#user'>
<item jid='my_id@my.domain.com/null' affiliation='owner' role='moderator'/>
<status code='110'/>
<status code='100'/>
<status code='201'/>
</x>
</presence>
当我尝试获取配置表单以设置房间字段时:
<iq from='my_id@my.domain.com/null' to='new_room_id@conference.my.domain.com/my_nickname' type='get' xmlns='jabber:client' id='iqid2:sendIQ'>
<query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>
我从 Ejabberd 服务器得到了答案:
<iq xmlns='jabber:client' from='new_room_id@conference.my.domain.com/my_nickname' to='my_id@my.domain.com/null' id='iqid2:sendIQ' type='get'>
<query xmlns='http://jabber.org/protocol/muc#owner'/>
</iq>
所以这是我的问题:
为什么 Ejabberd 服务器以相同类型响应我的查询,但不以 type='result' 或 type='error' 之类的方式响应?我用 type='set' 尝试了其他查询,同样的事情发生了。
为什么没有类似 :
<feature var='http://jabber.org/protocol/muc#owner'/>
或<feature var='http://jabber.org/protocol/muc#admin'/>
muc 服务的功能?似乎可以为房间创建 v-card,它是如何工作的?它是否需要在服务器端进行一些额外的配置?