all files / src/core/ Participant.js

0% Statements 0/5
100% Branches 0/0
0% Functions 0/1
0% Lines 0/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41                                                                                 
/**
 * {@link Room} participant
 * @public
 */
export default class Participant {
	/**
	 * Create a participant
	 * @param {Webcom/api.DataSnapshot|Object} snapData The data snapshot
	 * @access protected
	 */
	constructor(snapData) {
		const values = Object.assign({}, snapData.val());
		/**
		 * The participant unique id
		 * @type {string}
		 */
		this.uid = snapData.name();
		/**
		 * The Participant's role. Can be:
		 * - OWNER: the owner/creator of the {@link Room}
		 * - MODERATOR: a participant with {@link Room} management Rights
		 * - NONE: basic participant
		 * @type {string}
		 */
		this.role = values.role;
		/**
		 * The participant status Can be:
		 * - NOT_CONNECTED: the participant did not accept the invitation yet and/or did not join the {@link Room} yet
		 * - CONNECTED: the participant is in the {@link Room}
		 * - WAS_CONNECTED: the participant left the {@link Room}
		 * @type {string}
		 */
		this.status = values.status;
		/**
		 * Joined date
		 * @type {number}
		 */
		this._joined = values._joined;
	}
}