mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 15:27:49 +00:00
Until this commit we didn't make difference between transcriptions from the recording dialog and subtitles. Now subtitles are not considered recording anymore and only the transcriptions started from recording dialog are considered recording.
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
import {
|
|
HIDDEN_PARTICIPANT_JOINED,
|
|
HIDDEN_PARTICIPANT_LEFT,
|
|
PARTICIPANT_UPDATED
|
|
} from '../base/participants/actionTypes';
|
|
import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';
|
|
|
|
import {
|
|
potentialTranscriberJoined,
|
|
transcriberJoined,
|
|
transcriberLeft
|
|
} from './actions';
|
|
import './subscriber';
|
|
|
|
const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
|
|
|
|
/**
|
|
* Implements the middleware of the feature transcribing.
|
|
*
|
|
* @param {Store} store - The redux store.
|
|
* @returns {Function}
|
|
*/
|
|
// eslint-disable-next-line no-unused-vars
|
|
MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
|
|
const {
|
|
transcriberJID,
|
|
potentialTranscriberJIDs
|
|
} = getState()['features/transcribing'];
|
|
|
|
switch (action.type) {
|
|
case HIDDEN_PARTICIPANT_JOINED:
|
|
if (action.displayName === TRANSCRIBER_DISPLAY_NAME) {
|
|
dispatch(transcriberJoined(action.id));
|
|
} else {
|
|
dispatch(potentialTranscriberJoined(action.id));
|
|
}
|
|
|
|
break;
|
|
case HIDDEN_PARTICIPANT_LEFT:
|
|
if (action.id === transcriberJID) {
|
|
dispatch(transcriberLeft(action.id));
|
|
}
|
|
break;
|
|
case PARTICIPANT_UPDATED: {
|
|
const { participant } = action;
|
|
|
|
if (potentialTranscriberJIDs.includes(participant.id) && participant.name === TRANSCRIBER_DISPLAY_NAME) {
|
|
dispatch(transcriberJoined(participant.id));
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
return next(action);
|
|
});
|