Просмотр исходного кода

Revert "feat(avatars): use initials service for getting images (#2312)"

There is more avatar work coming down the line for mobile,
which should also affect web, assuming the same getAvatarURL
helper will be used. As such, instead of continuing to
support the initials service and tweaking UI, revert to
make way for the future avatar work.

This reverts commit 2ea5ad68a5.
master
Leonard Kim 7 лет назад
Родитель
Сommit
698ec1e2d7
1 измененных файлов: 5 добавлений и 28 удалений
  1. 5
    28
      react/features/base/participants/functions.js

+ 5
- 28
react/features/base/participants/functions.js Просмотреть файл

24
  * @returns {string} The URL of the image for the avatar of the specified
24
  * @returns {string} The URL of the image for the avatar of the specified
25
  * participant.
25
  * participant.
26
  */
26
  */
27
-export function getAvatarURL({ avatarID, avatarURL, email, id, name }: {
27
+export function getAvatarURL({ avatarID, avatarURL, email, id }: {
28
         avatarID: string,
28
         avatarID: string,
29
         avatarURL: string,
29
         avatarURL: string,
30
         email: string,
30
         email: string,
31
-        id: string,
32
-        name: string
31
+        id: string
33
 }) {
32
 }) {
34
     // If disableThirdPartyRequests disables third-party avatar services, we are
33
     // If disableThirdPartyRequests disables third-party avatar services, we are
35
     // restricted to a stock image of ours.
34
     // restricted to a stock image of ours.
69
         if (urlPrefix) {
68
         if (urlPrefix) {
70
             urlSuffix = interfaceConfig.RANDOM_AVATAR_URL_SUFFIX;
69
             urlSuffix = interfaceConfig.RANDOM_AVATAR_URL_SUFFIX;
71
         } else {
70
         } else {
72
-            urlPrefix = 'https://avatar-cdn.jitsi.net/';
73
-            urlSuffix = `/${_getInitials(name) || ' '}/200/avatar.png`;
71
+            // Otherwise, use a default (meeples, of course).
72
+            urlPrefix = 'https://abotars.jitsi.net/meeple/';
73
+            urlSuffix = '';
74
         }
74
         }
75
     }
75
     }
76
 
76
 
223
             ? stateful
223
             ? stateful
224
             : toState(stateful)['features/base/participants'] || []);
224
             : toState(stateful)['features/base/participants'] || []);
225
 }
225
 }
226
-
227
-/**
228
- * Gets the initials from a name, assuming a westernized name.
229
- *
230
- * @param {string} name - The name from which to parse initials.
231
- * @private
232
- * @returns {string}
233
- */
234
-function _getInitials(name) {
235
-    if (!name) {
236
-        return '';
237
-    }
238
-
239
-    const nameParts = name.toUpperCase().split(' ');
240
-    const firstName = nameParts[0];
241
-    let initials = firstName[0];
242
-
243
-    if (nameParts.length > 1) {
244
-        initials += nameParts[nameParts.length - 1];
245
-    }
246
-
247
-    return initials;
248
-}

Загрузка…
Отмена
Сохранить