Explorar el Código

ref(subtitles): remove logic around dialing transcriber (#4011)

j8
virtuacoplenny hace 6 años
padre
commit
866dc4dbc6
No account linked to committer's email address

+ 0
- 30
react/features/transcribing/actionTypes.js Ver fichero

@@ -1,23 +1,3 @@
1
-/**
2
- * The type of Redux action triggering the transcriber to join (be 'dialed' in)
3
- *
4
- * {
5
- *     type: DIAL_TRANSCRIBER
6
- * }
7
- * @public
8
- */
9
-export const DIAL_TRANSCRIBER = 'DIAL_TRANSCRIBER';
10
-
11
-/**
12
- * The type of Redux action triggering the transcriber to leave.
13
- *
14
- * {
15
- *     type: STOP_TRANSCRBIBING
16
- * }
17
- * @public
18
- */
19
-export const STOP_TRANSCRIBING = 'STOP_TRANSCRBIBING';
20
-
21 1
 /**
22 2
  * The type of Redux action triggering storage of participantId of transcriber,
23 3
  * so that it can later be kicked
@@ -53,16 +33,6 @@ export const _TRANSCRIBER_LEFT = 'TRANSCRIBER_LEFT';
53 33
 export const _POTENTIAL_TRANSCRIBER_JOINED
54 34
     = 'POTENTIAL_TRANSCRIBER_JOINED';
55 35
 
56
-/**
57
- * The type of a Redux action signalling that dialing the transcriber failed.
58
- *
59
- * {
60
- *     type: _DIAL_ERROR,
61
- * }
62
- * @private
63
- */
64
-export const _DIAL_ERROR = 'DIAL_ERROR';
65
-
66 36
 /**
67 37
  * The type of Redux action which sets the pending transcribing notification UID
68 38
  * to use it for when hiding the notification is necessary, or unsets it when

+ 1
- 44
react/features/transcribing/actions.js Ver fichero

@@ -1,13 +1,10 @@
1 1
 // @flow
2 2
 
3 3
 import {
4
-    _DIAL_ERROR,
5 4
     _POTENTIAL_TRANSCRIBER_JOINED,
6 5
     _TRANSCRIBER_JOINED,
7 6
     _TRANSCRIBER_LEFT,
8
-    DIAL_TRANSCRIBER,
9
-    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
10
-    STOP_TRANSCRIBING
7
+    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
11 8
 } from './actionTypes';
12 9
 import {
13 10
     NOTIFICATION_TIMEOUT,
@@ -16,33 +13,6 @@ import {
16 13
     showNotification
17 14
 } from '../notifications';
18 15
 
19
-/**
20
- * Dial the transcriber into the room.
21
- *
22
- * @public
23
- * @returns {{
24
- *     type: DIAL_TRANSCRIBER
25
- * }}
26
- */
27
-export function dialTranscriber() {
28
-    return {
29
-        type: DIAL_TRANSCRIBER
30
-    };
31
-}
32
-
33
-/**
34
- * Stop the transcribing by kicking the transcriber participant.
35
- *
36
- * @returns {{
37
- *     type: STOP_TRANSCRIBING
38
- * }}
39
- */
40
-export function stopTranscribing() {
41
-    return {
42
-        type: STOP_TRANSCRIBING
43
-    };
44
-}
45
-
46 16
 /**
47 17
  * Notify that the transcriber, with a unique ID, has joined.
48 18
  *
@@ -91,19 +61,6 @@ export function potentialTranscriberJoined(participantId: string) {
91 61
     };
92 62
 }
93 63
 
94
-/**
95
- * Notify that dialing the transcriber resulted in an error.
96
- *
97
- * @returns {{
98
- *      type: _DIAL_ERROR
99
- * }}
100
- */
101
-export function dialError() {
102
-    return {
103
-        type: _DIAL_ERROR
104
-    };
105
-}
106
-
107 64
 /**
108 65
  * Signals that the pending transcribing notification should be shown on the
109 66
  * screen.

+ 1
- 33
react/features/transcribing/middleware.js Ver fichero

@@ -3,17 +3,12 @@
3 3
 import { MiddlewareRegistry } from '../base/redux';
4 4
 
5 5
 import {
6
-    _TRANSCRIBER_LEFT,
7
-    DIAL_TRANSCRIBER,
8
-    STOP_TRANSCRIBING
6
+    _TRANSCRIBER_LEFT
9 7
 } from './actionTypes';
10 8
 import {
11
-    dialError,
12 9
     hidePendingTranscribingNotification,
13 10
     potentialTranscriberJoined,
14
-    showPendingTranscribingNotification,
15 11
     showStoppedTranscribingNotification,
16
-    showTranscribingError,
17 12
     transcriberJoined,
18 13
     transcriberLeft
19 14
 } from './actions';
@@ -23,9 +18,6 @@ import {
23 18
     PARTICIPANT_UPDATED
24 19
 } from './../base/participants';
25 20
 
26
-declare var APP: Object;
27
-
28
-const TRANSCRIBER_DIAL_COMMAND = 'jitsi_meet_transcribe';
29 21
 const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
30 22
 
31 23
 /**
@@ -37,35 +29,11 @@ const TRANSCRIBER_DISPLAY_NAME = 'Transcriber';
37 29
 // eslint-disable-next-line no-unused-vars
38 30
 MiddlewareRegistry.register(store => next => action => {
39 31
     const {
40
-        isDialing,
41
-        isTranscribing,
42 32
         transcriberJID,
43 33
         potentialTranscriberJIDs
44 34
     } = store.getState()['features/transcribing'];
45 35
 
46
-    const { conference } = store.getState()['features/base/conference'];
47
-
48 36
     switch (action.type) {
49
-    case DIAL_TRANSCRIBER:
50
-        if (!(isDialing || isTranscribing)) {
51
-            store.dispatch(showPendingTranscribingNotification());
52
-
53
-            conference.room.dial(TRANSCRIBER_DIAL_COMMAND).catch(
54
-                () => {
55
-                    store.dispatch(dialError());
56
-                    store.dispatch(hidePendingTranscribingNotification());
57
-                    store.dispatch(showTranscribingError());
58
-                }
59
-            );
60
-        }
61
-        break;
62
-    case STOP_TRANSCRIBING:
63
-        if (isTranscribing) {
64
-            const participant = conference.getParticipantById(transcriberJID);
65
-
66
-            conference.room.kick(participant.getJid());
67
-        }
68
-        break;
69 37
     case _TRANSCRIBER_LEFT:
70 38
         store.dispatch(showStoppedTranscribingNotification());
71 39
         break;

+ 1
- 20
react/features/transcribing/reducer.js Ver fichero

@@ -1,12 +1,9 @@
1 1
 import { ReducerRegistry } from '../base/redux';
2 2
 import {
3
-    _DIAL_ERROR,
4 3
     _TRANSCRIBER_JOINED,
5 4
     _TRANSCRIBER_LEFT,
6 5
     _POTENTIAL_TRANSCRIBER_JOINED,
7
-    DIAL_TRANSCRIBER,
8
-    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID,
9
-    STOP_TRANSCRIBING
6
+    SET_PENDING_TRANSCRIBING_NOTIFICATION_UID
10 7
 } from '../transcribing/actionTypes';
11 8
 
12 9
 /**
@@ -66,22 +63,6 @@ function _getInitialState() {
66 63
 ReducerRegistry.register('features/transcribing',
67 64
     (state = _getInitialState(), action) => {
68 65
         switch (action.type) {
69
-        case DIAL_TRANSCRIBER:
70
-            return {
71
-                ...state,
72
-                isDialing: true
73
-            };
74
-        case STOP_TRANSCRIBING:
75
-            return {
76
-                ...state,
77
-                isTerminating: true
78
-            };
79
-        case _DIAL_ERROR:
80
-            return {
81
-                ...state,
82
-                isDialing: false,
83
-                potentialTranscriberJIDs: []
84
-            };
85 66
         case _TRANSCRIBER_JOINED:
86 67
             return {
87 68
                 ...state,

Loading…
Cancelar
Guardar