Cisco AJAX XMPP Library :: Cisco-Specific Add-ons
This module provides a number of Cisco-specific extensions to the Cisco AJAX XMPP Library.
To install this module, copy the "jabberwerx.cisco.js" file into the same directory that contains "jabberwerx.js" and "jabberwerx.ui.js". Then modify your HTML pages to load "jabberwerx.cisco.js" after "jabberwerx.js" or "jabberwerx.ui.js".
The quick contacts feature provides support for managing temporary subscriptions to other contacts. This support is provided via a controller (jabberwerx.cisco.QuickContactController) and a model (jabberwerx.cisco.QuickContact). The controller provides methods for subscribing to, and unsubscribing from quick contacts. The model provides a Contact-based reprenstation of a QuickContact, allowing most other features of the Cisco AJAX XMPP Library to operate on QuickContacts as if it were another person in the roster.
To use QuickContacts, create a QuickContactController:
var quickCtrl = client.controller.quickContact || new jabberwerx.cisco.QuickContactController(client);
Once the client is connected, to add a quick contact, call QuickContactController's subscribe(jid) method:
quickCtrl.subscribe("email@example.com"); var contact = client.entitySet.entity("firstname.lastname@example.org");There should now be an entity for "email@example.com" in the client's entitySet. Usually this will be an instance of "jabberwerx.cisco.QuickContact". Now all presence changes for that contact are evented through the standard "resourcePresenceReceived" and "primaryPresenceReceived" events.
To remove a quick contact, call the entity's remove() method:
contact.remove();Alternatively, a quick contact can be removed by JID via the QuickContactController's unsubscribe(jid) method:
Once the client disconnects, all quick contacts are removed from the client's entitySet.
The quick contacts feature is meant to supplement the core roster features. As such, certain methods may behave slightly differently to accomodate roster-based contacts: