org.jivesoftware.xiff.conference

class Room

Object | +--org.jivesoftware.xiff.conference.Room

class Room extends Object
Manages incoming and outgoing data from a conference room as part of multi-user conferencing (JEP-0045). You will need an instance of this class for each room that the user joins. You can also use your own, external data provider if you choose, by using the setExternalDataProvider() method. This is most useful for applications where the data provider might need to be a class other than an array with the Data Provider API decorations, like in the case of a Macromedia Central LCDataProvider. Overall, however, its probably a rare occurence.
  • Author:
    Sean Voisen
  • Since:
    2.0.0

Field Summary

public addEventListener: Function
public static ADMIN_AFFILIATION: String
public static MEMBER_AFFILIATION: String
public static MODERATOR_ROLE: String
public static NO_AFFILIATION: String
public static NO_ROLE: String
public static OUTCAST_AFFILIATION: String
public static OWNER_AFFILIATION: String
public static PARTICIPANT_ROLE: String
public removeEventListener: Function
public static VISITOR_ROLE: String

Property Summary

public conferenceServer: String (read, write)
The conference server to use for this room. Usually, this is a subdomain of the primary XMPP server, like conference.myserver.com.
public length: Number (read-only)
public nickname: String (read)
The nickname to use when joining.
public nickname: (write)
public password: String (read, write)
public roomName: String (read, write)
The room name that should be used when joining.
public subject: String (read-only)

Constructor

public Room ( aConnection: XMPPConnection)

Method Summary

public allow ( jids: Array, callback: Function ): Void
Allow a previously banned JIDs to enter this room. This is the same as: Room.grant(NO_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
public ban ( jids: Array, callback: Function ): Void
Bans an arrya of JIDs from entering the room. This is the same as: Room.grant(OUTCAST_AFFILIATION, jid) If the process could not be completed, the room will dispatch the event adminError
public cancelConfiguration ( ): Void
Cancels the configuration process. The room may still be locked if you cancel the configuration process when attempting to join a reserved room. You must be joined to the room and have the owner affiliation to configure the room
public changeSubject ( newSubject: String ): Void
Changes the subject in the conference room. You must be joined to the room to change the subject
public configure ( fieldmap: Object ): Void
Sends a configuration form to the room. Accepts a fieldmap hash which is an object with keys being the variables and the values being arrays. For single value fields, use a single element array You must be joined and have owner affiliation to configure the room
public decline ( jid: String, reason: String ): Void
Actively decline an invitation. You can optionally ignore invitations but if you choose to decline an invitation, you call this method on a room instance that represents the room the invite originated from. You do not need to be joined to this room to decline an invitation Note: mu-conference-0.6 currently does not allow users to send decline messages without joining first. If using this version of conferencing software, it is best to ignore invites.
public destroy ( reason: String, alternateJID: String, callback: Function ): Void
Destroys a reserved room. If the room has been configured to be persistent, then it is optional that the server will permanently remove the room.
public getAffiliation ( ): String
Gets the user's affiliation for this room. Possible affiliations are "owner", "admin", "member", and "outcast". It is also possible to have no defined affiliation.
public getConnection ( ): XMPPConnection
Gets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
public getFullRoomName ( ): String
Gets the fully qualified room name (room@server) of the current room.
public getItemAt ( index: Number ): Object
public getItemID ( index: Number ): Number
public getLength ( ): Number
public getRole ( ): String
Gets the users role in the conference room. Possible roles are "visitor", "participant", "moderator" or no defined role.
public getRoomJID ( ): String
Get the JID of the room like XMPPConnection.getJID() used to send room messages
public getUserJID ( ): String
Get the JID of the user in the room like XMPPConnection.getJID() used to receive messages
public grant ( affiliation: String, jids: Array, callback: Function ): Void
Grants permissions on a room one or more JIDs by setting the affiliation of a user based * on their JID. Use one of the following affiliations: Room.MEMBER_AFFILIATION Room.ADMIN_AFFILIATION Room.OWNER_AFFILIATION If the JID currenly has an existing affiliation, then the existing affiliation will be replaced with the one passed. If the process could not be completed, the room will dispatch the event adminError
public invite ( jid: String, reason: String ): Void
Invites a user that is not currently a member of this room to this room. You must be joined to the room and have appropriate permissions to invite other memebers, as the room will format and send the invite message to the destination user rather that you sending the invite directly to the user. To listen to events, add an event listener on your XMPPConnection on the invite event.
public isActive ( ): Boolean
Determines whether the connection to the room is active - that is, the user is connected and has joined the room.
public isThisRoom ( sender: String ): Boolean
Tests if the parameter comes is the same as this room
public isThisUser ( sender: String ): Boolean
Tests if the parameter comes is the same user as that connected to the room
public join ( createReserved: Boolean ): Boolean
Joins a conference room based on the parameters specified by the room properties. This call will create an instant room based on a default server configuration if the room doesn't exist. To create and begin the configuration process of a reserved room, pass true to this method to begin the configuration process. When The configuration is complete, the room will be unlocked for others to join. Listen to the configureForm event to handle and either return or cancel the configuration of the room.
public kickOccupant ( occupantNick: String, reason: String ): Void
Kicks an occupant out of the room, assuming that the user has necessary permissions to do so. If the user does not, the server will return an error.
public leave ( ): Void
Leaves the current conference room, assuming that the user has joined one. If the user is not currently in a room, this method does nothing.
public requestAffiliations ( affiliation: String )
Requests an affiliation list for a given affiliation with with room. This will either broadcast the event affiliations or adminError depending on the result of the request Use one of the following affiliations: Room.NO_AFFILIATION Room.OUTCAST_AFFILIATION Room.MEMBER_AFFILIATION Room.ADMIN_AFFILIATION Room.OWNER_AFFILIATION
public requestConfiguration ( ): Void
Requests a configuration form from the room. Listen to configureForm event to fill out the form then call either configure or cancelConfiguration to complete the configuration process You must be joined to the room and have the owner affiliation to request a configuration form
public revoke ( jids: Array, callback: Function ): Void
Revokes all affiliations from the JIDs. This is the same as: grant(Room.NO_AFFILIATION, jids) If the process could not be completed, the room will dispatch the event adminError Note: if the JID is banned from this room, then this will also revoke their banned status.
public sendMessage ( body: String, htmlBody: String ): Void
Sends a message to the conference room.
public sendPrivateMessage ( recipientNickname: String, body: String, htmlBody: String )
Sends a private message to a specific participant in the conference room.
public setConnection ( connection: XMPPConnection ): Void
Sets a reference to the XMPPConnection being used for incoming/outgoing XMPP data.
public setExternalDataProvider ( externalDP: Object ): Void
Allows use of an external data provider instead of the one used internally by the class by default. This is useful in the case of a Macromedia Central application where the data provider might need to be an instance of an LCDataProvider. The data provider should either implement the Data Provider API interface, or the interface for Central's LCDataProvider.
public setOccupantVoice ( occupantNick: String, voice: Boolean ): Void
In a moderated room, sets voice status to a particular occupant, assuming the user has the necessary permissions to do so.
public setRoomJID ( jid: String ): Void
Set the JID of the room in the form "room@conference.server"
public sortItems ( compareFunc, optionFlags ): Void
public sortItemsBy ( fieldName, order ): Void

Field Documentation

addEventListener

public var addEventListener: Function

    ADMIN_AFFILIATION

    public static var ADMIN_AFFILIATION: String

      MEMBER_AFFILIATION

      public static var MEMBER_AFFILIATION: String

        MODERATOR_ROLE

        public static var MODERATOR_ROLE: String

          NO_AFFILIATION

          public static var NO_AFFILIATION: String

            NO_ROLE

            public static var NO_ROLE: String

              OUTCAST_AFFILIATION

              public static var OUTCAST_AFFILIATION: String

                OWNER_AFFILIATION

                public static var OWNER_AFFILIATION: String

                  PARTICIPANT_ROLE

                  public static var PARTICIPANT_ROLE: String

                    removeEventListener

                    public var removeEventListener: Function

                      VISITOR_ROLE

                      public static var VISITOR_ROLE: String

                        Property Documentation

                        length

                        public length: Number (read-only)

                          nickname

                          public nickname: (write)

                            password

                            public password: String (read, write)

                              subject

                              public subject: String (read-only)

                                Constructor Documentation

                                Room

                                public function Room (
                                aConnection: XMPPConnection)

                                  Method Documentation

                                  getItemAt

                                  public function getItemAt (
                                  index: Number): Object

                                    getItemID

                                    public function getItemID (
                                    index: Number): Number

                                      getLength

                                      public function getLength (
                                      ): Number