Selaa lähdekoodia

Make 'connected' an attribute.

JC Brand 9 vuotta sitten
vanhempi
commit
3815d77cc1
2 muutettua tiedostoa jossa 3 lisäystä ja 5 poistoa
  1. 2 2
      docs/source/development.rst
  2. 1 3
      src/converse-api.js

+ 2 - 2
docs/source/development.rst

@@ -386,8 +386,8 @@ This grouping collects API functions related to the XMPP connection.
 connected
 ~~~~~~~~~
 
-Returns a boolean value (`true` or `false`) depending on whether there is an
-established connection.
+A boolean attribute (i.e. not a callable) which is set to `true` or `false` depending
+on whether there is an established connection.
 
 disconnect
 ~~~~~~~~~~

+ 1 - 3
src/converse-api.js

@@ -26,9 +26,7 @@
             converse.initialize(settings, callback);
         },
         'connection': {
-            'connected': function () {
-                return converse.connection.connected;
-            },
+            'connected': converse.connection.connected,
             'disconnect': function () {
                 converse.connection.disconnect();
             },