title: XMPP Multi-User Chat Room Disconnecting Error
body: <p>I was able to create a MUC chat room using javascript, XMPP, Strophe, and openFire. The room was created and different user can join. Below is the code used to create the room:</p>
  
  <pre><code>function onConnected(status)
  {
      if (status === Strophe.Status.CONNECTED) 
      {
          con.addHandler(on_presence, null, "presence");
          con.addHandler(on_public_message, null, "message", "groupchat");
          con.addHandler(on_private_message, null, "message", "chat");
  
          con.muc.init(con);
          var d = $pres({"from":"louis@louis-tosh","to":"myroom@conference.louis-tosh/Louis"})
          .c("x",{"xmlns":"http://jabber.org/protocol/muc"});
  
          con.send(d.tree());
          con.muc.createInstantRoom("myroom@conference.louis-tosh");
      }
  }
  </code></pre>
  
  <p>The "myroom" is now created and automatically "louis@louis-tosh" joined the room.
  Waiting a few second, louis@louis-tosh user is suddenly disconnected (left the room). As this user disconnect, an on presence stanza is alerted. The on presence code is below:</p>
  
  <pre><code>function on_presence (presence)
  {
      var from = $(presence).attr('from');
      var room = Strophe.getBareJidFromJid(from);
      var nick = Strophe.getResourceFromJid(from);
  
      var show = $(presence).find("show").text();
      if (show === "" || show === "chat") 
      {
          alert('Presence From: ' + from + "(Online)");
      } 
      else if(show === "dnd")
      {
          alert('Presence From: ' + from + "(Busy)");
      }
      else
      {
          alert('Presence From: ' + from + "(Away)");
      }
  
      return true;
  }
  </code></pre>
  
  <p>I need to know why this disconnecting issue is occurring and if their is any suggestions on the above code. Any help or suggestion is really useful.</p>