feat(config) add gravatar config object (#11509)

This commit is contained in:
Mihaela Dumitru 2022-05-09 08:36:39 +03:00 committed by GitHub
parent 64d44f0ac2
commit 36578696bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View File

@ -586,8 +586,17 @@ var config = {
// Array with avatar URL prefixes that need to use CORS.
// corsAvatarURLs: [ 'https://www.gravatar.com/avatar/' ],
// Base URL for a Gravatar-compatible service. Defaults to libravatar.
// gravatarBaseURL: 'https://seccdn.libravatar.org/avatar/',
// Base URL for a Gravatar-compatible service. Defaults to Gravatar.
// DEPRECATED! Use `gravatar.baseUrl` instead.
// gravatarBaseURL: 'https://www.gravatar.com/avatar/',
// Setup for Gravatar-compatible services.
// gravatar: {
// // Defaults to Gravatar.
// baseUrl: 'https://www.gravatar.com/avatar/',
// // True if Gravatar should be disabled.
// disabled: false
// },
// App name to be displayed in the invitation email subject, as an alternative to
// interfaceConfig.APP_NAME.

View File

@ -163,6 +163,7 @@ export default [
'gatherStats',
'giphy',
'googleApiApplicationClientID',
'gravatar.disabled',
'hiddenPremeetingButtons',
'hideConferenceSubject',
'hideDisplayName',

View File

@ -30,10 +30,13 @@ const AVATAR_CHECKER_FUNCTIONS = [
return participant && participant.avatarURL ? participant.avatarURL : null;
},
(participant, store) => {
if (participant && participant.email) {
// TODO: remove once libravatar has deployed their new scaled up infra. -saghul
const gravatarBaseURL
= store.getState()['features/base/config'].gravatarBaseURL ?? GRAVATAR_BASE_URL;
const config = store.getState()['features/base/config'];
const isGravatarDisabled = config.gravatar?.disabled;
if (participant && participant.email && !isGravatarDisabled) {
const gravatarBaseURL = config.gravatar?.baseUrl
|| config.gravatarBaseURL
|| GRAVATAR_BASE_URL;
return getGravatarURL(participant.email, gravatarBaseURL);
}