Class jabberwerx.cisco.QuickContactController
Extends
jabberwerx.Controller.
Quick contact Controller class is responsible for quick contact subscriptions/unsubscriptions.
It is also registered to listen to temp presence pubsub notification events.| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Creates a new QuickContactController with the given client. |
| Field Attributes | Field Name and Description |
|---|---|
- Fields borrowed from class jabberwerx.Controller:
- client, name
| Method Attributes | Method Name and Description |
|---|---|
|
cleanupEntity(entity)
Cleanup QuickContact entity on behalf of the client entity set jabberwerx.EntitySet. |
|
|
destroy()
Unbinds events and calls base class method. |
|
|
Handle custom serialization. |
|
|
removeEntity(entity)
Deletes the given entity. |
|
|
subscribe(jid)
This function sends direct presence with caps containing temp presence feautre to the given jid. |
|
|
subscribeAll(jids, reset)
Temp subscribe to multiple contacts. |
|
|
unsubscribe(jid)
This function removes temp presence feature for the given jid. |
|
|
unsubscribeAll(jids)
Unsubscribe temp subscriptions for multiple contacts. |
|
|
Handle custom serialization. |
- Methods borrowed from class jabberwerx.Controller:
- updateEntity
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event, shouldBeSavedWithGraph
- Methods borrowed from class jabberwerx.JWBase:
- extend, getClassName, init, intercept, invocation, mixin, shouldBeSerializedInline, toString, wasUnserialized
Creates a new QuickContactController with the given client.
- Parameters:
- {jabberwerx.Client} client
- The owning client
- Throws:
- {TypeError}
- If {client} is not valid
Cleanup QuickContact entity on behalf of the client entity set jabberwerx.EntitySet.
- Parameters:
- {jabberwerx.Entity} entity
- The entity to destroy
Unbinds events and calls base class method.
Handle custom serialization. Override base class to start pending work queue timer if a queue is not empty.
Deletes the given entity. This method is invoked from jabberwerx.Entity#remove method.
- Parameters:
- {jabberwerx.cisco.QuickContact} entity
- The entity to delete
- Throws:
- {TypeError}
- If {entity} is not a Contact
This function sends direct presence with caps containing temp presence feautre to the given jid. Returns false if already subscribed to the jid and true otherwise.
- Parameters:
- {JID} jid
- for which to subscribe to temp presence changes
- Throws:
- {TypeError}
- If {entity} is RosterContact with status "both" or "to"
- Returns:
- {Boolean} true if successfully added, false if unsuccessful
Temp subscribe to multiple contacts. Send a temp subscription to each jid in the given list. JIDS already subscribed to are ignored. Any errors encountered while subscribing (ie an invalid jid) are logged but otherwise ignored.
None of the jids in the given list is guarenteed to be subscribed when this method returns. Subscription operations occur on a work queue {@see #subscriptionInterval} {@see #subscriptionSlice}, whose execution will occur sometime after this method returns.
An optional reset parameter will unsubscribe from all temp subscriptions in the entity cache before adding new subscriptions. Existing temp subs that are in the given list are not removed or resubscribed.
- Parameters:
- {[jabberwerx.JID|String]} jids
- List of jids or JID strings to subscribe. May be an empty array.
- {Boolean} reset Optional
- Unsubscribe from all temp subs currently in the entity cache before subscribing to jids. Default is false, no unsubscriptions are performed.
- Throws:
- TypeError if jids is not an array.
This function removes temp presence feature for the given jid. and sends direct presence stanza to the jid. Returns false if not currently subscribed to the temp presence from jid and true otherwise.
- Parameters:
- {JID} jid
- for which to subscribe to temp presence changes
- Returns:
- {Boolean} true if successfully removed, false if unsuccessful
Unsubscribe temp subscriptions for multiple contacts. Unsubscribe from any temp subscriptions to the jids in the given list. If no temp subscription exists for the jid it is ignored. Any errors encountered while unsubscribing (ie an invalid jid) are logged but otherwise ignored.
None of the jids in the given list is guarenteed to be unsubscribed when this method returns. Bulk Subscription operations occur on a work queue {@see #subscriptionInterval} {@see #subscriptionSlice}, whose execution will occur sometime after this method returns.
- Parameters:
- {[jabberwerx.JID|String]} jids
- List of bare JIDs or JID Strings to unsubscribe. May be an empty array.
- Throws:
- TypeError if jids is not an array.
Handle custom serialization. Override base class to clear pending work queue timer as needed. _pending queues are persisted automatically.