希望有人可以帮助我理解我在尝试加入已存在的公共 MUC 房间时收到的错误代码 404。
这是 XMPP 序列:
-
对房间进行IQ查询
<iq from='[email protected] /cdn-cgi/l/email-protection/BridgeClient' id='0da67229d8f55e3b'
to='[email protected] /cdn-cgi/l/email-protection' type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
-
IQ 查询的响应
<iq from='[email protected] /cdn-cgi/l/email-protection' to='[email protected] /cdn-cgi/l/email-protection/BridgeClient' type='result' id='0da67229d8f55e3b'>
<query xmlns='http://jabber.org/protocol/disco#info'>
<identity category='conference' name='sdfsdfsdf' type='text'/>
<feature var='http://jabber.org/protocol/muc'/>
<feature var='http://jabber.org/protocol/muc#unique'/>
<feature var='muc_temporary'/><feature var='muc_open'/>
<feature var='muc_public'/><feature var='muc_unsecured'/>
<feature var='muc_temporary'/><feature var='muc_anonymous'/>
<x xmlns='jabber:x:data' type='result'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/muc#roominfo</value>
</field>
<field label='Subject Modifiable' var='muc#roominfo_subjectmod' type='boolean'>
<value>0</value>
</field><field label='Current Occupants' var='muc#roominfo_occupants' type='text-single'>
<value>1</value>
</field>
</x>
</query></iq>
-
尝试使用状态加入房间
<presence from='[email protected] /cdn-cgi/l/email-protection/BridgeClient' id='0da67229d8f55e3b' to='[email protected] /cdn-cgi/l/email-protection/bbbb'>
<x xmlns='http://jabber.org/protocol/muc'/>
</presence>
-
加入响应(错误 404)
<presence from='[email protected] /cdn-cgi/l/email-protection' to='[email protected] /cdn-cgi/l/email-protection/BridgeClient' type='error' id='0da67229d8f55e3b'>
<x xmlns='http://jabber.org/protocol/muc'/>
<error code='404' type='cancel'>
<item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</presence>
有人知道为什么我进不了房间吗?我刚刚通过早些时候加入临时房间来创建它,但是在加入之后我无法再返回,即使 IQ 结果显示它是“muc_open”。
更新:我正在查看 MUC XEP-0045 文档,发现以下段落解释了我的问题。
http://xmpp.org/extensions/xep-0045.html#createroom-instant http://xmpp.org/extensions/xep-0045.html#createroom-instant
我没有意识到简单地加入房间并没有完成该过程,您仍然必须告诉服务器您要接受即时房间部分的所有默认设置,否则它会保持锁定状态。
作为记录,在创建房间(并成为所有者)后发送下面的代码片段解决了我的问题。
<iq from='[email protected] /cdn-cgi/l/email-protection/desktop'
id='create1'
to='[email protected] /cdn-cgi/l/email-protection'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#owner'>
<x xmlns='jabber:x:data' type='submit'/>
</query>
</iq>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)