Class Index | Minimal

Classes


Class jabberwerx.Presence (MINIMAL)


Extends jabberwerx.Stanza.

Represents a <presence/> stanza.

Class Summary
Constructor Attributes Constructor Name and Description
 

Creates a new Presence object.

Field Summary
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 Summary
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.

 

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
 

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
Class Detail
jabberwerx.Presence(packet)

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
Field Detail
<static> <constant> {String} jabberwerx.Presence.SHOW_AWAY
The "away" status.

<static> <constant> {String} jabberwerx.Presence.SHOW_CHAT
The "chat" status.

<static> <constant> {String} jabberwerx.Presence.SHOW_DND
The "dnd" status.

<static> <constant> {String} jabberwerx.Presence.SHOW_NORMAL
The "normal" status.

<static> <constant> {String} jabberwerx.Presence.SHOW_XA
The "xa" status.
Method Detail
{Integer} compareTo(presence)

Compares this Presence to the given presence object for natural ordering. The order is determined via:

  1. The <priority/> values
  2. 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}

{Number} getPriority()

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

{String} getShow()

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

{String} getStatus()

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

{jabberwerx.Presence} setPresence(show, status, priority)
Sets show, status and priority via a single method call
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

setPriority(pri)

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.

setShow(show)

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".

setStatus(status)

Changes or removes the status value for this Presence.

Parameters:
{String} status Optional
The new status value

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 02 2014 13:23:42 GMT-0600 (MDT)