|
|
@@ -516,10 +516,12 @@ JitsiConference.prototype._init = function(options = {}) {
|
|
516
|
516
|
/**
|
|
517
|
517
|
* Joins the conference.
|
|
518
|
518
|
* @param password {string} the password
|
|
|
519
|
+ * @param replaceParticipant {boolean} whether the current join replaces
|
|
|
520
|
+ * an existing participant with same jwt from the meeting.
|
|
519
|
521
|
*/
|
|
520
|
|
-JitsiConference.prototype.join = function(password) {
|
|
|
522
|
+JitsiConference.prototype.join = function(password, replaceParticipant = false) {
|
|
521
|
523
|
if (this.room) {
|
|
522
|
|
- this.room.join(password).then(() => this._maybeSetSITimeout());
|
|
|
524
|
+ this.room.join(password, replaceParticipant).then(() => this._maybeSetSITimeout());
|
|
523
|
525
|
}
|
|
524
|
526
|
};
|
|
525
|
527
|
|
|
|
@@ -1584,9 +1586,11 @@ JitsiConference.prototype.muteParticipant = function(id, mediaType) {
|
|
1584
|
1586
|
* @param botType the member botType, if any
|
|
1585
|
1587
|
* @param fullJid the member full jid, if any
|
|
1586
|
1588
|
* @param features the member botType, if any
|
|
|
1589
|
+ * @param isReplaceParticipant whether this join replaces a participant with
|
|
|
1590
|
+ * the same jwt.
|
|
1587
|
1591
|
*/
|
|
1588
|
1592
|
JitsiConference.prototype.onMemberJoined = function(
|
|
1589
|
|
- jid, nick, role, isHidden, statsID, status, identity, botType, fullJid, features) {
|
|
|
1593
|
+ jid, nick, role, isHidden, statsID, status, identity, botType, fullJid, features, isReplaceParticipant) {
|
|
1590
|
1594
|
const id = Strophe.getResourceFromJid(jid);
|
|
1591
|
1595
|
|
|
1592
|
1596
|
if (id === 'focus' || this.myUserId() === id) {
|
|
|
@@ -1599,6 +1603,7 @@ JitsiConference.prototype.onMemberJoined = function(
|
|
1599
|
1603
|
participant.setRole(role);
|
|
1600
|
1604
|
participant.setBotType(botType);
|
|
1601
|
1605
|
participant.setFeatures(features);
|
|
|
1606
|
+ participant.setIsReplacing(isReplaceParticipant);
|
|
1602
|
1607
|
|
|
1603
|
1608
|
this.participants[id] = participant;
|
|
1604
|
1609
|
this.eventEmitter.emit(
|
|
|
@@ -1727,6 +1732,8 @@ JitsiConference.prototype.onMemberLeft = function(jid) {
|
|
1727
|
1732
|
});
|
|
1728
|
1733
|
};
|
|
1729
|
1734
|
|
|
|
1735
|
+/* eslint-disable max-params */
|
|
|
1736
|
+
|
|
1730
|
1737
|
/**
|
|
1731
|
1738
|
* Designates an event indicating that we were kicked from the XMPP MUC.
|
|
1732
|
1739
|
* @param {boolean} isSelfPresence - whether it is for local participant
|
|
|
@@ -1736,8 +1743,15 @@ JitsiConference.prototype.onMemberLeft = function(jid) {
|
|
1736
|
1743
|
* @param {string?} kickedParticipantId - when it is not a kick for local participant,
|
|
1737
|
1744
|
* this is the id of the participant which was kicked.
|
|
1738
|
1745
|
* @param {string} reason - reason of the participant to kick
|
|
|
1746
|
+ * @param {boolean?} isReplaceParticipant - whether this is a server initiated kick in order
|
|
|
1747
|
+ * to replace it with a participant with same jwt.
|
|
1739
|
1748
|
*/
|
|
1740
|
|
-JitsiConference.prototype.onMemberKicked = function(isSelfPresence, actorId, kickedParticipantId, reason) {
|
|
|
1749
|
+JitsiConference.prototype.onMemberKicked = function(
|
|
|
1750
|
+ isSelfPresence,
|
|
|
1751
|
+ actorId,
|
|
|
1752
|
+ kickedParticipantId,
|
|
|
1753
|
+ reason,
|
|
|
1754
|
+ isReplaceParticipant) {
|
|
1741
|
1755
|
// This check which be true when we kick someone else. With the introduction of lobby
|
|
1742
|
1756
|
// the ChatRoom KICKED event is now also emitted for ourselves (the kicker) so we want to
|
|
1743
|
1757
|
// avoid emitting an event where `undefined` kicked someone.
|
|
|
@@ -1749,7 +1763,7 @@ JitsiConference.prototype.onMemberKicked = function(isSelfPresence, actorId, kic
|
|
1749
|
1763
|
|
|
1750
|
1764
|
if (isSelfPresence) {
|
|
1751
|
1765
|
this.eventEmitter.emit(
|
|
1752
|
|
- JitsiConferenceEvents.KICKED, actorParticipant, reason);
|
|
|
1766
|
+ JitsiConferenceEvents.KICKED, actorParticipant, reason, isReplaceParticipant);
|
|
1753
|
1767
|
|
|
1754
|
1768
|
this.leave();
|
|
1755
|
1769
|
|
|
|
@@ -1758,6 +1772,8 @@ JitsiConference.prototype.onMemberKicked = function(isSelfPresence, actorId, kic
|
|
1758
|
1772
|
|
|
1759
|
1773
|
const kickedParticipant = this.participants[kickedParticipantId];
|
|
1760
|
1774
|
|
|
|
1775
|
+ kickedParticipant.setIsReplaced(isReplaceParticipant);
|
|
|
1776
|
+
|
|
1761
|
1777
|
this.eventEmitter.emit(
|
|
1762
|
1778
|
JitsiConferenceEvents.PARTICIPANT_KICKED, actorParticipant, kickedParticipant, reason);
|
|
1763
|
1779
|
};
|