瀏覽代碼

[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.
j8
Lyubo Marinov 7 年之前
父節點
當前提交
ce1a8e7567

+ 1
- 2
react/features/base/jwt/middleware.js 查看文件

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

+ 0
- 9
react/features/base/participants/constants.js 查看文件

21
  */
21
  */
22
 export const LOCAL_PARTICIPANT_DEFAULT_ID = 'local';
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
  * Max length of the display names.
25
  * Max length of the display names.
35
  *
26
  *

+ 3
- 17
react/features/base/participants/reducer.js 查看文件

11
     PARTICIPANT_UPDATED,
11
     PARTICIPANT_UPDATED,
12
     PIN_PARTICIPANT
12
     PIN_PARTICIPANT
13
 } from './actionTypes';
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
  * Participant object.
17
  * Participant object.
80
             email,
76
             email,
81
             isBot,
77
             isBot,
82
             local,
78
             local,
79
+            name,
83
             pinned,
80
             pinned,
84
             role
81
             role
85
         } = participant;
82
         } = participant;
86
-        let { avatarID, id, name } = participant;
83
+        let { avatarID, id } = participant;
87
 
84
 
88
         // avatarID
85
         // avatarID
89
         //
86
         //
101
             id = LOCAL_PARTICIPANT_DEFAULT_ID;
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
         return {
101
         return {
116
             avatarID,
102
             avatarID,
117
             avatarURL,
103
             avatarURL,

Loading…
取消
儲存