瀏覽代碼

Fixed auth.

It depended on triggering events for which we've removed the handlers
JC Brand 12 年之前
父節點
當前提交
98bbb79176
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      converse.js

+ 4 - 3
converse.js

@@ -1865,15 +1865,16 @@
 
             connection.connect(jid, password, $.proxy(function (status) {
                 if (status === Strophe.Status.CONNECTED) {
-                    $(document).trigger('jarnxmpp.connected', connection);
+                    console.log('Connected');
+                    converse.onConnected(connection);
                 } else if (status === Strophe.Status.DISCONNECTED) {
                     console.log('Disconnected');
-                    $(document).trigger('jarnxmpp.disconnected');
+                    this.$feedback.text('Unable to communicate with chat server').css('background-image', "url(images/error_icon.png)");
                 } else if (status === Strophe.Status.Error) {
                     console.log('Error');
                 } else if (status === Strophe.Status.CONNECTING) {
                     console.log('Connecting');
-                    $(document).trigger('jarnxmpp.connecting');
+                    this.$feedback.text('Connecting to chat...');
                 } else if (status === Strophe.Status.CONNFAIL) {
                     console.log('Connection Failed');
                 } else if (status === Strophe.Status.AUTHENTICATING) {