Преглед изворни кода

avatars: ensure no remote avatar is loaded when disableThirdPartyRequests is set

master
Saúl Ibarra Corretgé пре 5 година
родитељ
комит
ed8009883b

+ 3
- 1
react/features/base/participants/middleware.js Прегледај датотеку

343
     // to the new avatar and emit out change events if necessary.
343
     // to the new avatar and emit out change events if necessary.
344
     const result = next(action);
344
     const result = next(action);
345
 
345
 
346
-    if (avatarURL || email || id || name) {
346
+    const { disableThirdPartyRequests } = getState()['features/base/config'];
347
+
348
+    if (!disableThirdPartyRequests && (avatarURL || email || id || name)) {
347
         const participantId = !id && local ? getLocalParticipant(getState()).id : id;
349
         const participantId = !id && local ? getLocalParticipant(getState()).id : id;
348
         const updatedParticipant = getParticipantById(getState(), participantId);
350
         const updatedParticipant = getParticipantById(getState(), participantId);
349
 
351
 

+ 0
- 6
react/features/base/participants/preloadImage.web.js Прегледај датотеку

3
 
3
 
4
 import { isIconUrl } from './functions';
4
 import { isIconUrl } from './functions';
5
 
5
 
6
-declare var config: Object;
7
-
8
 /**
6
 /**
9
  * Tries to preload an image.
7
  * Tries to preload an image.
10
  *
8
  *
16
         return Promise.resolve(src);
14
         return Promise.resolve(src);
17
     }
15
     }
18
 
16
 
19
-    if (typeof config === 'object' && config.disableThirdPartyRequests) {
20
-        return Promise.reject();
21
-    }
22
-
23
     return new Promise((resolve, reject) => {
17
     return new Promise((resolve, reject) => {
24
         const image = document.createElement('img');
18
         const image = document.createElement('img');
25
 
19
 

Loading…
Откажи
Сачувај