Browse Source

Add CONFERENCE_WILL_JOIN action

It's fired before creating the conference with lib-jitsi-meet.
j8
Saúl Ibarra Corretgé 8 years ago
parent
commit
b1b5f3e6f0

+ 11
- 0
react/features/base/conference/actionTypes.js View File

23
  */
23
  */
24
 export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED');
24
 export const CONFERENCE_JOINED = Symbol('CONFERENCE_JOINED');
25
 
25
 
26
+/**
27
+ * The type of the Redux action which signals that a specific conference will be
28
+ * joined.
29
+ *
30
+ * {
31
+ *     type: CONFERENCE_WILL_JOIN,
32
+ *     room: string
33
+ * }
34
+ */
35
+export const CONFERENCE_WILL_JOIN = Symbol('CONFERENCE_WILL_JOIN');
36
+
26
 /**
37
 /**
27
  * The type of the Redux action which signals that a specific conference has
38
  * The type of the Redux action which signals that a specific conference has
28
  * been left.
39
  * been left.

+ 27
- 3
react/features/base/conference/actions.js View File

12
     CONFERENCE_FAILED,
12
     CONFERENCE_FAILED,
13
     CONFERENCE_JOINED,
13
     CONFERENCE_JOINED,
14
     CONFERENCE_LEFT,
14
     CONFERENCE_LEFT,
15
+    CONFERENCE_WILL_JOIN,
15
     CONFERENCE_WILL_LEAVE,
16
     CONFERENCE_WILL_LEAVE,
16
     LOCK_STATE_CHANGED,
17
     LOCK_STATE_CHANGED,
17
     SET_PASSWORD,
18
     SET_PASSWORD,
123
     };
124
     };
124
 }
125
 }
125
 
126
 
127
+/**
128
+ * Signals the intention of the application to have the local participant leave
129
+ * a specific conference. Similar in fashion to CONFERENCE_LEFT. Contrary to it
130
+ * though, it's not guaranteed because CONFERENCE_LEFT may be triggered by
131
+ * lib-jitsi-meet and not the application.
132
+ *
133
+ * @param {string} room - The JitsiConference instance which will
134
+ * be left by the local participant.
135
+ * @returns {{
136
+ *      type: CONFERENCE_WILL_JOIN,
137
+ *      room: string
138
+ *  }}
139
+ */
140
+function _conferenceWillJoin(room) {
141
+    return {
142
+        type: CONFERENCE_WILL_JOIN,
143
+        room
144
+    };
145
+}
146
+
126
 /**
147
 /**
127
  * Signals that a specific conference has been left.
148
  * Signals that a specific conference has been left.
128
  *
149
  *
180
             throw new Error('Cannot join conference without room name');
201
             throw new Error('Cannot join conference without room name');
181
         }
202
         }
182
 
203
 
204
+        // XXX Lib-jitsi-meet does not accept uppercase letters.
205
+        const _room = room.toLowerCase();
206
+
207
+        dispatch(_conferenceWillJoin(_room));
208
+
183
         // TODO Take options from config.
209
         // TODO Take options from config.
184
         const conference
210
         const conference
185
             = connection.initJitsiConference(
211
             = connection.initJitsiConference(
186
-
187
-                    // XXX Lib-jitsi-meet does not accept uppercase letters.
188
-                    room.toLowerCase(),
212
+                    _room,
189
                     { openSctp: true });
213
                     { openSctp: true });
190
 
214
 
191
         _addConferenceListeners(conference, dispatch);
215
         _addConferenceListeners(conference, dispatch);

Loading…
Cancel
Save