Class jabberwerx.MUCOccupant
Extends
jabberwerx.Entity.
Represents an occupant in a Multi-User Chat (MUC) room.
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.MUCOccupant(room, nick)
Creates a new instance of MUCOccupant with the given room and nickname. |
Field Attributes | Field Name and Description |
---|---|
The owning MUC Room. |
- Fields borrowed from class jabberwerx.Entity:
- features, identities, jid, node, properties
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. |
|
setDisplayName(name)
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
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
The owning MUC Room.
Retrieves the display name for this MUCOccupant. This method overrides the base to only return #getNickname.
- Returns:
- {String} The display name (occupant nickname)
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
Determines if this MUCOccupant represents the current user.
- Returns:
- {Boolean} true if this occupant is for the current logged-in user.
Override of the base to prevent display name changes.
- Parameters:
- {String} name Optional
- The new display name (ignored)
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.