title: Converse opening a chat from API
body: <p>I'm looking into ways to open a chat window with a user via the API.</p>
  
  <p>I have set up (and registered in the whitelist) a plugin, which triggers.</p>
  
  <pre><code>    converse.plugins.add('startChat', {
          initialize: function () {
              this._converse.on('connected', function () {
                  console.log("wibble");
                  this._converse.api.chats.open('user@chat.domain.com');
              });
            }
        });
  </code></pre>
  
  <p>This is firing, but no chat is initiated. I get the following errors in console:</p>
  
  <pre><code>wibble
  
  converse.js:48049
  FATAL: TypeError: Cannot read property 'get' of undefined
      at child.createChatBox (/converse.js:50015:56)
      at child.getChatBox (/converse.js:50050:40)
      at Object.open (/converse.js:50153:84)
      at Object.&lt;anonymous&gt; (Page.aspx:1264:41)
      at triggerEvents (/converse.js:46015:57)
      at triggerApi (/converse.js:46003:19)
      at eventsApi (/converse.js:45802:16)
      at Object.Events.trigger (/converse.js:45993:5)
      at Object._converse.emit (/converse.js:48071:27)
      at Object.onConnected (/converse.js:48671:27)
  
  converse.js:48041 
  ERROR: User connection callback caused an exception: TypeError: Cannot read property 'get' of undefined
  </code></pre>