Przeglądaj źródła

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

master
Mihaela Dumitru 3 lat temu
rodzic
commit
36578696bb
No account linked to committer's email address

+ 11
- 2
config.js Wyświetl plik

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

+ 1
- 0
react/features/base/config/configWhitelist.js Wyświetl plik

@@ -163,6 +163,7 @@ export default [
163 163
     'gatherStats',
164 164
     'giphy',
165 165
     'googleApiApplicationClientID',
166
+    'gravatar.disabled',
166 167
     'hiddenPremeetingButtons',
167 168
     'hideConferenceSubject',
168 169
     'hideDisplayName',

+ 7
- 4
react/features/base/participants/functions.js Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz