XMPP MUC returns error code 404 when joining, but

2019-07-02 00:53发布

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'.

标签: xmpp chat
1条回答
相关推荐>>
2楼-- · 2019-07-02 01:43

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>
查看更多
登录 后发表回答