Class Index | Minimal

Classes


Class jabberwerx.MUCOccupant


Extends jabberwerx.Entity.

Represents an occupant in a Multi-User Chat (MUC) room.

Class Summary
Constructor Attributes Constructor Name and Description
 

Creates a new instance of MUCOccupant with the given room and nickname.

Field Summary
Field Attributes Field Name and Description
 

The owning MUC Room.

Fields borrowed from class jabberwerx.Entity:
features, identities, jid, node, properties
Method Summary
Method Attributes Method Name and Description
 

Retrieves the display name for this MUCOccupant.

 

Retrieves the nickname for this MUCOccupant.

 
isMe()

Determines if this MUCOccupant represents the current user.

 

Override of the base to prevent display name changes.

 
updatePresence(presence)

Update presence for this MUCOccupant.

Methods borrowed from class jabberwerx.Entity:
apply, destroy, getAllPresence, getGroups, getPrimaryPresence, getResourcePresence, hasFeature, hasIdentity, isActive, matches, remove, setGroups, toString, update
Methods borrowed from class jabberwerx.JWModel:
applyEvent, event, shouldBeSavedWithGraph
Methods borrowed from class jabberwerx.JWBase:
getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, wasUnserialized, willBeSerialized
Class Detail
jabberwerx.MUCOccupant(room, nick)

Creates a new instance of MUCOccupant with the given room and nickname. The created occupant is registered with the owning room's jabberwerx.MUCRoom#occupants as part of this call.

NOTE: This type should not be directly created. MUCRooms create occupants as necessary.

Parameters:
{jabberwerx.MUCRoom} room
The owning room
{String} nick
The nickname
Throws:
{TypeError}
If {room} is not a valid MUCRoom; or if {nick} is not a non-empty string
Field Detail
{jabberwerx.MUCRoom} room

The owning MUC Room.

Method Detail
{String} getDisplayName()

Retrieves the display name for this MUCOccupant. This method overrides the base to only return #getNickname.

Returns:
{String} The display name (occupant nickname)

{String} getNickname()

Retrieves the nickname for this MUCOccupant. This is a convenience that always returns the resource portion of the occupant's JID.

Returns:
{String} The nickname

{Boolean} isMe()

Determines if this MUCOccupant represents the current user.

Returns:
{Boolean} true if this occupant is for the current logged-in user.

setDisplayName(name)

Override of the base to prevent display name changes.

Parameters:
{String} name Optional
The new display name (ignored)

{Boolean} updatePresence(presence)

Update presence for this MUCOccupant.

This method overrides the base to only retain at most one presence instance. This method always results in both "resourcePresenceChanged" and "primaryPresenceChanged" events being triggered.

Parameters:
{jabberwerx.Presence} presence
The presence to update from
Throws:
{TypeError}
If {presence} is not a valid availability or unavailability presence for this entity
Returns:
{Boolean} true if primary presence changed.

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