Class jabberwerx.PrivacyListController
Extends
jabberwerx.Controller.
Controller class for privacy lists functionality.
This class provides the following events:
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.PrivacyListController(client)
Creates a new PrivacyListController with the given client. |
- Fields borrowed from class jabberwerx.Controller:
- client, name
Method Attributes | Method Name and Description |
---|---|
apply(list, callback)
Sets the active privacy list (or null/undefined to clear active). |
|
destroy()
Destroys privacy list controller and removes any event callbacks it registered. |
|
fetch(list, callback)
Fetch a privacy list by name, creates jabberwerx.PrivacyList object and adds it to the map. |
- Methods borrowed from class jabberwerx.Controller:
- cleanupEntity, removeEntity, updateEntity
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event, shouldBeSavedWithGraph
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString, wasUnserialized, willBeSerialized
Creates a new PrivacyListController with the given client.
- Parameters:
- {jabberwerx.Client} client
- The client object to use for communicating to the server
- Throws:
- {TypeError}
- If {client} is not an instance of jabberwerx.Client
Sets the active privacy list (or null/undefined to clear active).
- Parameters:
- {String} list
- Name of the privacy list.
- {function} callback Optional
- The function called after the server response is processed. If a server error
occurs, the function will be passed the error stanza response.
The signature of the function is
callback(errorStanza)
.The callback will be invoked in the context of the PrivacyListController e.g.
callback.call(this, errorStanza)
. Therefore in the callback methodthis
will refer to the instance of PrivacyListController and sothis.client
will retrieve the jabberwerx.Client object.
- Throws:
- {jabberwerx.Client.NotConnectedError}
- If the jabberwerx.Client is not connected
- {TypeError}
- If {list} is not a <string/><PrivacyList/>
Destroys privacy list controller and removes any event callbacks it registered.
Fetch a privacy list by name, creates jabberwerx.PrivacyList object and adds it to the map.
- Parameters:
- {String} list
- Name of the privacy list.
- {function} callback Optional
- The function called after the server response is processed. If a server error
occurs, the function will be passed the error stanza response.
The signature of the function is
e.g.callback(errorStanza)
.callback.call(this, errorStanza)
. Therefore in the callback methodthis
will refer to the instance of PrivacyListController and sothis.client
will retrieve the jabberwerx.Client object
- Throws:
- {TypeError}
- If {list} is not a <string/><PrivacyList/>
- {jabberwerx.Client.NotConnectedError}
- If the jabberwerx.Client is not connected