|
@@ -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
|
|
-}
|