Browse Source

[RN] Allow uppsercase letters in room names

master
Lyubomir Marinov 9 years ago
parent
commit
de5cd53f85
2 changed files with 28 additions and 11 deletions
  1. 1
    1
      react/features/app/functions.js
  2. 27
    10
      react/features/base/conference/reducer.js

+ 1
- 1
react/features/app/functions.js View File

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

+ 27
- 10
react/features/base/conference/reducer.js View File

59
                         'leavingJitsiConference',
59
                         'leavingJitsiConference',
60
                         action.conference.jitsiConference));
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
         return state;
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
+}

Loading…
Cancel
Save