Browse Source

[RN] Don't tell everyone we're called "me"

Recently/as part of the work on taking into account the user defined by
JWT, the local participant (on mobile) started telling the remote
participants that he/she had the display name "me". Obviously, that's
incorrect. Do not store the default display name in redux. While it may
be argues that redux is the place for all states, base/participants and
the name property of Participant is not meant to be that display name
because that is being sent to remote participants, the default name
needs to be internationalized, etc. So it's better to not store the
default display name at this time at all because it's not used by mobile
anyway and Web already deals with remote participants who don't share
their display names.
master
Lyubo Marinov 7 years ago
parent
commit
ce1a8e7567

+ 1
- 2
react/features/base/jwt/middleware.js View File

@@ -14,7 +14,6 @@ import { LIB_INIT_ERROR } from '../lib-jitsi-meet';
14 14
 import {
15 15
     getLocalParticipant,
16 16
     getParticipantCount,
17
-    LOCAL_PARTICIPANT_DEFAULT_NAME,
18 17
     PARTICIPANT_JOINED,
19 18
     participantUpdated
20 19
 } from '../participants';
@@ -274,7 +273,7 @@ function _undoOverwriteLocalParticipant(
274 273
             newProperties.email = undefined;
275 274
         }
276 275
         if (name === localParticipant.name) {
277
-            newProperties.name = LOCAL_PARTICIPANT_DEFAULT_NAME;
276
+            newProperties.name = undefined;
278 277
         }
279 278
         dispatch(participantUpdated(newProperties));
280 279
     }

+ 0
- 9
react/features/base/participants/constants.js View File

@@ -21,15 +21,6 @@ export const DEFAULT_AVATAR_RELATIVE_PATH = 'images/avatar.png';
21 21
  */
22 22
 export const LOCAL_PARTICIPANT_DEFAULT_ID = 'local';
23 23
 
24
-/**
25
- * The default display name of the local participant.
26
- *
27
- * TODO Get the display name from config and/or localized.
28
- *
29
- * @type {string}
30
- */
31
-export const LOCAL_PARTICIPANT_DEFAULT_NAME = 'me';
32
-
33 24
 /**
34 25
  * Max length of the display names.
35 26
  *

+ 3
- 17
react/features/base/participants/reducer.js View File

@@ -11,11 +11,7 @@ import {
11 11
     PARTICIPANT_UPDATED,
12 12
     PIN_PARTICIPANT
13 13
 } from './actionTypes';
14
-import {
15
-    LOCAL_PARTICIPANT_DEFAULT_ID,
16
-    LOCAL_PARTICIPANT_DEFAULT_NAME,
17
-    PARTICIPANT_ROLE
18
-} from './constants';
14
+import { LOCAL_PARTICIPANT_DEFAULT_ID, PARTICIPANT_ROLE } from './constants';
19 15
 
20 16
 /**
21 17
  * Participant object.
@@ -80,10 +76,11 @@ function _participant(state: Object = {}, action) {
80 76
             email,
81 77
             isBot,
82 78
             local,
79
+            name,
83 80
             pinned,
84 81
             role
85 82
         } = participant;
86
-        let { avatarID, id, name } = participant;
83
+        let { avatarID, id } = participant;
87 84
 
88 85
         // avatarID
89 86
         //
@@ -101,17 +98,6 @@ function _participant(state: Object = {}, action) {
101 98
             id = LOCAL_PARTICIPANT_DEFAULT_ID;
102 99
         }
103 100
 
104
-        // name
105
-        if (!name) {
106
-            // TODO Get the display name from config and/or localized.
107
-            // XXX On Web the default value is handled in conference.js by
108
-            // getParticipantDisplayName.
109
-            if (typeof APP === 'undefined') {
110
-                name
111
-                    = local ? LOCAL_PARTICIPANT_DEFAULT_NAME : 'Fellow Jitster';
112
-            }
113
-        }
114
-
115 101
         return {
116 102
             avatarID,
117 103
             avatarURL,

Loading…
Cancel
Save