/* eslint-disable */ import { $iq, Strophe } from 'strophe.js'; Strophe.addConnectionPlugin('disco', { _connection: null, _identities : [], _features : [], _items : [], /** Function: init * Plugin init * * Parameters: * (Strophe.Connection) conn - Strophe connection */ init: function(conn) { this._connection = conn; this._identities = []; this._features = []; this._items = []; // disco info conn.addHandler(this._onDiscoInfo.bind(this), Strophe.NS.DISCO_INFO, 'iq', 'get', null, null); // disco items conn.addHandler(this._onDiscoItems.bind(this), Strophe.NS.DISCO_ITEMS, 'iq', 'get', null, null); }, /** Function: addIdentity * See http://xmpp.org/registrar/disco-categories.html * Parameters: * (String) category - category of identity (like client, automation, etc ...) * (String) type - type of identity (like pc, web, bot , etc ...) * (String) name - name of identity in natural language * (String) lang - lang of name parameter * * Returns: * Boolean */ addIdentity: function(category, type, name, lang) { if (typeof name === 'undefined') { name = ''; } if (typeof lang === 'undefined') { lang = ''; } for (var i=0; i