Browse Source

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 years ago
parent
commit
698ec1e2d7
1 changed files with 5 additions and 28 deletions
  1. 5
    28
      react/features/base/participants/functions.js

+ 5
- 28
react/features/base/participants/functions.js View File

@@ -24,12 +24,11 @@ declare var interfaceConfig: Object;
24 24
  * @returns {string} The URL of the image for the avatar of the specified
25 25
  * participant.
26 26
  */
27
-export function getAvatarURL({ avatarID, avatarURL, email, id, name }: {
27
+export function getAvatarURL({ avatarID, avatarURL, email, id }: {
28 28
         avatarID: string,
29 29
         avatarURL: string,
30 30
         email: string,
31
-        id: string,
32
-        name: string
31
+        id: string
33 32
 }) {
34 33
     // If disableThirdPartyRequests disables third-party avatar services, we are
35 34
     // restricted to a stock image of ours.
@@ -69,8 +68,9 @@ export function getAvatarURL({ avatarID, avatarURL, email, id, name }: {
69 68
         if (urlPrefix) {
70 69
             urlSuffix = interfaceConfig.RANDOM_AVATAR_URL_SUFFIX;
71 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,26 +223,3 @@ function _getAllParticipants(stateful) {
223 223
             ? stateful
224 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
-}

Loading…
Cancel
Save