Преглед на файлове

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

master
Saúl Ibarra Corretgé преди 5 години
родител
ревизия
ed8009883b
променени са 2 файла, в които са добавени 3 реда и са изтрити 7 реда
  1. 3
    1
      react/features/base/participants/middleware.js
  2. 0
    6
      react/features/base/participants/preloadImage.web.js

+ 3
- 1
react/features/base/participants/middleware.js Целия файл

@@ -343,7 +343,9 @@ function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
343 343
     // to the new avatar and emit out change events if necessary.
344 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 349
         const participantId = !id && local ? getLocalParticipant(getState()).id : id;
348 350
         const updatedParticipant = getParticipantById(getState(), participantId);
349 351
 

+ 0
- 6
react/features/base/participants/preloadImage.web.js Целия файл

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

Loading…
Отказ
Запис