浏览代码

Doesn't look like its necessary to call initConnection again

JC Brand 7 年之前
父节点
当前提交
d49adc9309
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/converse-core.js

+ 2 - 2
src/converse-core.js

@@ -627,7 +627,6 @@
         };
 
         this.initStatus = (reconnecting) => {
-
             // If there's no xmppstatus obj, then we were never connected to
             // begin with, so we set reconnecting to false.
             reconnecting = _.isUndefined(_converse.xmppstatus) ? false : reconnecting;
@@ -1791,6 +1790,8 @@
         };
 
         this.initConnection = function () {
+            /* Creates a new Strophe.Connection instance if we don't already have one.
+             */
             if (!this.connection) {
                 if (!this.bosh_service_url && ! this.websocket_url) {
                     throw new Error("initConnection: you must supply a value for either the bosh_service_url or websocket_url or both.");
@@ -1927,7 +1928,6 @@
                 return _converse.connection.jid;
             },
             'login' (credentials) {
-                _converse.initConnection();
                 _converse.logIn(credentials);
             },
             'logout' () {