avatars: ensure no remote avatar is loaded when disableThirdPartyRequests is set
This commit is contained in:
parent
4fd5dc0ee0
commit
ed8009883b
|
@ -343,7 +343,9 @@ function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
|
||||||
// to the new avatar and emit out change events if necessary.
|
// to the new avatar and emit out change events if necessary.
|
||||||
const result = next(action);
|
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 participantId = !id && local ? getLocalParticipant(getState()).id : id;
|
||||||
const updatedParticipant = getParticipantById(getState(), participantId);
|
const updatedParticipant = getParticipantById(getState(), participantId);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
import { isIconUrl } from './functions';
|
import { isIconUrl } from './functions';
|
||||||
|
|
||||||
declare var config: Object;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to preload an image.
|
* Tries to preload an image.
|
||||||
*
|
*
|
||||||
|
@ -16,10 +14,6 @@ export function preloadImage(src: string | Object): Promise<string> {
|
||||||
return Promise.resolve(src);
|
return Promise.resolve(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof config === 'object' && config.disableThirdPartyRequests) {
|
|
||||||
return Promise.reject();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const image = document.createElement('img');
|
const image = document.createElement('img');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue