Ver código fonte

[RN] Allow uppsercase letters in room names

master
Lyubomir Marinov 9 anos atrás
pai
commit
de5cd53f85

+ 1
- 1
react/features/app/functions.js Ver arquivo

@@ -19,7 +19,7 @@ function _getRoomAndDomainFromUrlObject(url) {
19 19
 
20 20
     if (url) {
21 21
         domain = url.hostname;
22
-        room = url.pathname.substr(1).toLowerCase();
22
+        room = url.pathname.substr(1);
23 23
 
24 24
         // Convert empty string to undefined to simplify checks.
25 25
         if (room === '') {

+ 27
- 10
react/features/base/conference/reducer.js Ver arquivo

@@ -59,17 +59,34 @@ ReducerRegistry.register('features/base/conference',
59 59
                         'leavingJitsiConference',
60 60
                         action.conference.jitsiConference));
61 61
 
62
-        case SET_ROOM: {
63
-            let room = action.room;
64
-
65
-            // Technically, there're multiple values which don't represent
66
-            // valid room names. Practically, each of them is as bad as the rest
67
-            // of them because we can't use any of them to join a conference.
68
-            isRoomValid(room) || (room = INITIAL_STATE.room);
69
-
70
-            return setStateProperty(state, 'room', room);
71
-        }
62
+        case SET_ROOM:
63
+            return _setRoom(state, action);
72 64
         }
73 65
 
74 66
         return state;
75 67
     });
68
+
69
+/**
70
+ * Reduces a specific Redux action SET_ROOM of the feature base/conference.
71
+ *
72
+ * @param {Object} state - The Redux state of the feature base/conference.
73
+ * @param {Action} action - The Redux action SET_ROOM to reduce.
74
+ * @private
75
+ * @returns {Object} The new state of the feature base/conference after the
76
+ * reduction of the specified action.
77
+ */
78
+function _setRoom(state, action) {
79
+    let room = action.room;
80
+
81
+    if (isRoomValid(room)) {
82
+        // XXX Lib-jitsi-meet does not accept uppercase letters.
83
+        room = room.toLowerCase();
84
+    } else {
85
+        // Technically, there are multiple values which don't represent valid
86
+        // room names. Practically, each of them is as bad as the rest of them
87
+        // because we can't use any of them to join a conference.
88
+        room = INITIAL_STATE.room;
89
+    }
90
+
91
+    return setStateProperty(state, 'room', room);
92
+}

Carregando…
Cancelar
Salvar