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

This commit is contained in:
Saúl Ibarra Corretgé 2020-03-28 20:24:27 +01:00 committed by Saúl Ibarra Corretgé
parent 4fd5dc0ee0
commit ed8009883b
2 changed files with 3 additions and 7 deletions

View File

@ -343,7 +343,9 @@ function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
// to the new avatar and emit out change events if necessary.
const result = next(action);
if (avatarURL || email || id || name) {
const { disableThirdPartyRequests } = getState()['features/base/config'];
if (!disableThirdPartyRequests && (avatarURL || email || id || name)) {
const participantId = !id && local ? getLocalParticipant(getState()).id : id;
const updatedParticipant = getParticipantById(getState(), participantId);

View File

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