XMPP MUC returns error code 404 when joining, but it exists

瘦欲@ 提交于 2019-12-14 01:30:06

问题


Hoping somebody can help me make sense of this Error code 404 I'm getting when attempting to join a public MUC room that already exists.

Here's the XMPP Sequence:

  1. Perform IQ Query on room

    <iq from='bridgetest1@jabber.org/BridgeClient' id='0da67229d8f55e3b' 
    to='sdfsdfsdf@conference.jabber.org' type='get'> 
      <query xmlns='http://jabber.org/protocol/disco#info'/>
    </iq>
    
  2. Response from IQ Query

    <iq from='sdfsdfsdf@conference.jabber.org' to='bridgetest1@jabber.org/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>
    
  3. Attempt to join room using Presence

    <presence from='bridgetest1@jabber.org/BridgeClient' id='0da67229d8f55e3b' to='sdfsdfsdf@conference.jabber.org/bbbb'>
       <x xmlns='http://jabber.org/protocol/muc'/>
    </presence>
    
  4. Join Response (Error 404)

    <presence from='sdfsdfsdf@conference.jabber.org' to='bridgetest1@jabber.org/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>
    

Does anybody know why I can't join the room? I just created that temporary room by joining it earlier, but after I've joined it I cannot get back in, even though the IQ results show it being 'muc_open'.


回答1:


Update: I was reviewing the MUC XEP-0045 document and found the following passage that explains my issue.

http://xmpp.org/extensions/xep-0045.html#createroom-instant

I did not realize that simply joining a room did not complete the process, you still have to tell the server that you want to accept all default settings with the instant room portion, otherwise it remains locked.

For the record, sending the snippet below after creating the room (and being the owner) solves my problem.

    <iq from='crone1@shakespeare.lit/desktop'
        id='create1'
        to='coven@chat.shakespeare.lit'
        type='set'>
        <query xmlns='http://jabber.org/protocol/muc#owner'>
            <x xmlns='jabber:x:data' type='submit'/>
        </query>
    </iq>


来源:https://stackoverflow.com/questions/15488843/xmpp-muc-returns-error-code-404-when-joining-but-it-exists

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