Class jabberwerx.RosterContact
Extends
jabberwerx.Contact.
RosterContact object which is part of a user's roster. This object SHOULD NOT be created directly. Instead, it should be created via jabberwerx.RosterController#addContact.
This entity has the following in its #properties map:
| Name | Type | Description |
|---|---|---|
| name | String | The nickname from the server (may be "") |
| subscription | String | The subscription state (one of "none", "to", "from", or "both") |
| ask | String | The pending subscription state (one of "subscribe", "unsubscribe", or "") |
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
jabberwerx.RosterContact(item, roster)
Creates a new Contact with the given item node and creating RosterController |
- Fields borrowed from class jabberwerx.Entity:
- features, identities, jid, node, properties
| Method Attributes | Method Name and Description |
|---|---|
|
Retrieves the display name of this contact. |
|
|
Get the contact node object |
|
|
remove()
Deletes this Contact. |
|
|
setDisplayName(name)
Changes or removes the display name for this Contact. |
|
|
Changes or removes the groups for this Contact. |
|
|
setItemNode(node)
Sets the contact node object. |
- Methods borrowed from class jabberwerx.Entity:
- apply, destroy, getAllPresence, getGroups, getPrimaryPresence, getResourcePresence, hasFeature, hasIdentity, isActive, matches, toString, update, updatePresence
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event, shouldBeSavedWithGraph
- Methods borrowed from class jabberwerx.JWBase:
- extend, getClassName, graphUnserialized, init, intercept, invocation, mixin, shouldBeSerializedInline, wasUnserialized, willBeSerialized
Creates a new Contact with the given item node and creating RosterController
- Parameters:
- {Element} item
- A DOM node which represents an <item> element
- {jabberwerx.RosterController} roster
- The creating RosterController
- Throws:
- {TypeError}
- If {item} is not a valid DOM element; or if {roster} is not a valid RosterController
Retrieves the display name of this contact. This method overrides the base to use the properties name, or the default implementation if no server-side name is present.
- Returns:
- {String} The display name
Get the contact node object
- Returns:
- {Node} A DOM node which represents an <item> element
Deletes this Contact. This method overrides the base class to instead operate via jabberwerx.RosterController#deleteContact.
Changes or removes the display name for this Contact. This method overrides the base class to instead change the display name via jabberwerx.RosterController#updateContact.
- Parameters:
- {String} name
- The display name to be set
Changes or removes the groups for this Contact. This method overrides the base class to instead operate via jabberwerx.RosteControllerr#updateContact.
- Parameters:
- {String] The name of groups
Sets the contact node object. Calling this method triggers an "entityUpdated" event.
This method SHOULD NOT be called directly.
- Parameters:
- {Node} node
- A DOM node which represents an <item> element
- Throws:
- {TypeError}
- if {node} is not valid