Browse Source

Converse.js now responds to XEP-0030 Service discovery requests.

JC Brand 11 years ago
parent
commit
156d231c95
2 changed files with 27 additions and 0 deletions
  1. 25 0
      converse.js
  2. 2 0
      docs/CHANGES.rst

+ 25 - 0
converse.js

@@ -3998,6 +3998,7 @@
             */
             model: converse.Feature,
             initialize: function () {
+                this.addClientIdentities().addClientFeatures();
                 this.browserStorage = new Backbone.BrowserStorage[converse.storage](
                     b64_sha1('converse.features'+converse.bare_jid));
                 if (this.browserStorage.records.length === 0) {
@@ -4010,6 +4011,30 @@
                 }
             },
 
+            addClientIdentities: function () {
+                /* See http://xmpp.org/registrar/disco-categories.html
+                 */
+                 converse.connection.disco.addIdentity('client', 'web', 'Converse.js');
+                 return this;
+            },
+
+            addClientFeatures: function () {
+                /* The strophe.disco.js plugin keeps a list of features which
+                 * it will advertise to any #info queries made to it.
+                 *
+                 * See: http://xmpp.org/extensions/xep-0030.html#info
+                 */
+                 converse.connection.disco.addFeature('http://jabber.org/protocol/chatstates'); // Limited support
+                 converse.connection.disco.addFeature('http://jabber.org/protocol/rosterx'); // Limited support
+                 converse.connection.disco.addFeature('jabber:x:conference');
+                 converse.connection.disco.addFeature('urn:xmpp:carbons:2');
+                 converse.connection.disco.addFeature('vcard-temp');
+                 converse.connection.disco.addFeature(Strophe.NS.BOSH);
+                 converse.connection.disco.addFeature(Strophe.NS.DISCO_INFO);
+                 converse.connection.disco.addFeature(Strophe.NS.MUC);
+                 return this;
+            },
+
             onItems: function (stanza) {
                 $(stanza).find('query item').each($.proxy(function (idx, item) {
                     converse.connection.disco.info(

+ 2 - 0
docs/CHANGES.rst

@@ -4,6 +4,8 @@ Changelog
 0.8.1 (Unreleased)
 ------------------
 
+* Converse.js now responds to XEP-0030: Service Discovery requests. [jcbrand]
+* #215 (and also #75) XEP-0249: Direct MUC Invitations. [jcbrand]
 * #216 Contacts tab empty when using xhr_user_search. [hcderaad and jcbrand]
 
 0.8.1 (2014-08-23)