Class jabberwerx.Presence (MINIMAL)
Extends
jabberwerx.Stanza.
Represents a <presence/> stanza.
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.Presence(packet)
Creates a new Presence object. |
Field Attributes | Field Name and Description |
---|---|
<static> <constant> |
jabberwerx.Presence.SHOW_AWAY
The "away" status.
|
<static> <constant> |
jabberwerx.Presence.SHOW_CHAT
The "chat" status.
|
<static> <constant> |
jabberwerx.Presence.SHOW_DND
The "dnd" status.
|
<static> <constant> |
jabberwerx.Presence.SHOW_NORMAL
The "normal" status.
|
<static> <constant> |
jabberwerx.Presence.SHOW_XA
The "xa" status.
|
- Fields borrowed from class jabberwerx.Stanza:
- timestamp
Method Attributes | Method Name and Description |
---|---|
compareTo(presence)
Compares this Presence to the given presence object for natural ordering. |
|
Retrieves the priority for this Presence. |
|
getShow()
Retrieves the show value for this Presence. |
|
Retrieves the status value for this Presence. |
|
setPresence(show, status, priority)
Sets show, status and priority via a single method call
|
|
setPriority(pri)
Changes or removes the priority for this Presence. |
|
setShow(show)
Changes or removes the show value for this Presence. |
|
setStatus(status)
Changes or removes the status value for this Presence. |
- Methods borrowed from class jabberwerx.Stanza:
- clone, errorReply, getDoc, getErrorInfo, getFrom, getFromJID, getID, getNode, getTo, getToJID, getType, isError, pType, setFrom, setID, setTo, setType, swap, wasUnserialized, willBeSerialized, xml
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event, shouldBeSavedWithGraph
- Methods borrowed from class jabberwerx.JWBase:
- destroy, getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString
Creates a new Presence object.
- Parameters:
- {Element} packet Optional
- The <presence/> element, or null for an empty Presence
- Throws:
- {TypeError}
- If {packet} is not an <presence/> element
Compares this Presence to the given presence object for natural ordering. The order is determined via:
- The <priority/> values
- The timestamps
A missing <priority/> value is equal to "0".
- Parameters:
- {jabberwerx.Presence} presence
- Object to compare against
- Returns:
- {Integer} -1, 1, or 0 if this Presence is before, after, or in the same position as {presence}
Retrieves the priority for this Presence. This method returns the integer value for the <priority/> child element's text content, or 0 if none is available.
- Returns:
- {Number} The priority
Retrieves the show value for this Presence. This method returns the text content of the <show/> child eleemnt, or #.SHOW_NORMAL if none is available.
- Returns:
- {String} The show value
Retrieves the status value for this Presence. This method returns the text content of the <status/> child element, or null if none is available.
- Returns:
- {String} The show value
- Parameters:
- {String} show Optional
- A status message
- {String} status Optional
- A status indicator
- {Integer} priority Optional
- A priority for this resource
- Returns:
- {jabberwerx.Presence} This updated presence stanza
Changes or removes the priority for this Presence.
- Parameters:
- {Number} pri Optional
- The new priority
- Throws:
- {TypeError}
- If {pri} is defined and not a number.
Changes or removes the show value for this Presence.
- Parameters:
- {String} show Optional
- The new show value
- Throws:
- {TypeError}
- If {show} is defined and not one of "away", "chat", "dnd", or "xa".
Changes or removes the status value for this Presence.
- Parameters:
- {String} status Optional
- The new status value