mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 12:57:49 +00:00
feat(replace-participant): Replace participant with same jwt in the conf
- update lib-jitsi-meet to version with support for replacing participant
This commit is contained in:
committed by
Horatiu Muresan
parent
60188794b5
commit
342dd4ceca
@@ -460,7 +460,7 @@ export function createConference() {
|
||||
|
||||
sendLocalParticipant(state, conference);
|
||||
|
||||
conference.join(password);
|
||||
conference.join(password, config.replaceParticipant);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -477,8 +477,11 @@ export function checkIfCanJoin() {
|
||||
const { authRequired, password }
|
||||
= getState()['features/base/conference'];
|
||||
|
||||
const { replaceParticipant }
|
||||
= getState()['features/base/config'];
|
||||
|
||||
authRequired && dispatch(_conferenceWillJoin(authRequired));
|
||||
authRequired && authRequired.join(password);
|
||||
authRequired && authRequired.join(password, replaceParticipant);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,8 @@ export function commonUserJoinedHandling(
|
||||
if (user.isHidden()) {
|
||||
dispatch(hiddenParticipantJoined(id, displayName));
|
||||
} else {
|
||||
const isReplacing = user.isReplacing && user.isReplacing();
|
||||
|
||||
dispatch(participantJoined({
|
||||
botType: user.getBotType(),
|
||||
connectionStatus: user.getConnectionStatus(),
|
||||
@@ -94,7 +96,8 @@ export function commonUserJoinedHandling(
|
||||
id,
|
||||
name: displayName,
|
||||
presence: user.getStatus(),
|
||||
role: user.getRole()
|
||||
role: user.getRole(),
|
||||
isReplacing
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -119,7 +122,9 @@ export function commonUserLeftHandling(
|
||||
if (user.isHidden()) {
|
||||
dispatch(hiddenParticipantLeft(id));
|
||||
} else {
|
||||
dispatch(participantLeft(id, conference));
|
||||
const isReplaced = user.isReplaced && user.isReplaced();
|
||||
|
||||
dispatch(participantLeft(id, conference, isReplaced));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ export default [
|
||||
'requireDisplayName',
|
||||
'remoteVideoMenu',
|
||||
'roomPasswordNumberOfDigits',
|
||||
'replaceParticipant',
|
||||
'resolution',
|
||||
'startAudioMuted',
|
||||
'startAudioOnly',
|
||||
|
||||
@@ -366,6 +366,7 @@ export function hiddenParticipantLeft(id) {
|
||||
* with the participant identified by the specified {@code id}. Only the local
|
||||
* participant is allowed to not specify an associated {@code JitsiConference}
|
||||
* instance.
|
||||
* @param {boolean} isReplaced - Whether the participant is to be replaced in the meeting.
|
||||
* @returns {{
|
||||
* type: PARTICIPANT_LEFT,
|
||||
* participant: {
|
||||
@@ -374,12 +375,13 @@ export function hiddenParticipantLeft(id) {
|
||||
* }
|
||||
* }}
|
||||
*/
|
||||
export function participantLeft(id, conference) {
|
||||
export function participantLeft(id, conference, isReplaced) {
|
||||
return {
|
||||
type: PARTICIPANT_LEFT,
|
||||
participant: {
|
||||
conference,
|
||||
id
|
||||
id,
|
||||
isReplaced
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -490,9 +492,13 @@ export function participantKicked(kicker, kicked) {
|
||||
dispatch({
|
||||
type: PARTICIPANT_KICKED,
|
||||
kicked: kicked.getId(),
|
||||
kicker: kicker.getId()
|
||||
kicker: kicker?.getId()
|
||||
});
|
||||
|
||||
if (kicked.isReplaced && kicked.isReplaced()) {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(showNotification({
|
||||
titleArguments: {
|
||||
kicked:
|
||||
|
||||
@@ -161,7 +161,7 @@ StateListenerRegistry.register(
|
||||
for (const p of getState()['features/base/participants']) {
|
||||
!p.local
|
||||
&& (!conference || p.conference !== conference)
|
||||
&& dispatch(participantLeft(p.id, p.conference));
|
||||
&& dispatch(participantLeft(p.id, p.conference, p.isReplaced));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -356,14 +356,16 @@ function _maybePlaySounds({ getState, dispatch }, action) {
|
||||
if (!action.participant.local
|
||||
&& (!startAudioMuted
|
||||
|| getParticipantCount(state) < startAudioMuted)) {
|
||||
const { isReplacing, isReplaced } = action.participant;
|
||||
|
||||
if (action.type === PARTICIPANT_JOINED) {
|
||||
const { presence } = action.participant;
|
||||
|
||||
// The sounds for the poltergeist are handled by features/invite.
|
||||
if (presence !== INVITED && presence !== CALLING) {
|
||||
if (presence !== INVITED && presence !== CALLING && !isReplacing) {
|
||||
dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID));
|
||||
}
|
||||
} else if (action.type === PARTICIPANT_LEFT) {
|
||||
} else if (action.type === PARTICIPANT_LEFT && !isReplaced) {
|
||||
dispatch(playSound(PARTICIPANT_LEFT_SOUND_ID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +187,7 @@ function _participantJoined({ participant }) {
|
||||
dominantSpeaker,
|
||||
email,
|
||||
isFakeParticipant,
|
||||
isReplacing,
|
||||
isJigasi,
|
||||
loadableAvatarUrl,
|
||||
local,
|
||||
@@ -218,6 +219,7 @@ function _participantJoined({ participant }) {
|
||||
email,
|
||||
id,
|
||||
isFakeParticipant,
|
||||
isReplacing,
|
||||
isJigasi,
|
||||
loadableAvatarUrl,
|
||||
local: local || false,
|
||||
|
||||
Reference in New Issue
Block a user