Compare commits

...

5 Commits

Author SHA1 Message Date
yanas ba28b9f17d Revert "feat(avatars): use initials service for getting images (#2312)"
This reverts commit 2ea5ad68a5.
2017-12-28 13:23:49 -06:00
yanas 1fb8697850 Revert "doc: Adds a note on security (as suggested in #409). (#2322)"
This reverts commit 1255b3349b.
2017-12-28 13:23:49 -06:00
yanas 1b587da4cf Revert "Commit from translate.jitsi.org by user damencho.: 399 of 399 strings translated (0 fuzzy)."
This reverts commit eb64b74493.
2017-12-28 13:23:49 -06:00
yanas a2a1aac76a Revert "New files added from translate.jitsi.org based on templates"
This reverts commit 6146c12533.
2017-12-28 13:23:49 -06:00
yanas 3869aaecba Revert "ref(toolbar): re-wrap buttons for torture tests"
This reverts commit e217c172f8.
2017-12-28 13:23:49 -06:00
1 changed files with 5 additions and 28 deletions

View File

@ -24,12 +24,11 @@ declare var interfaceConfig: Object;
* @returns {string} The URL of the image for the avatar of the specified
* participant.
*/
export function getAvatarURL({ avatarID, avatarURL, email, id, name }: {
export function getAvatarURL({ avatarID, avatarURL, email, id }: {
avatarID: string,
avatarURL: string,
email: string,
id: string,
name: string
id: string
}) {
// If disableThirdPartyRequests disables third-party avatar services, we are
// restricted to a stock image of ours.
@ -69,8 +68,9 @@ export function getAvatarURL({ avatarID, avatarURL, email, id, name }: {
if (urlPrefix) {
urlSuffix = interfaceConfig.RANDOM_AVATAR_URL_SUFFIX;
} else {
urlPrefix = 'https://avatar-cdn.jitsi.net/';
urlSuffix = `/${_getInitials(name) || ' '}/200/avatar.png`;
// Otherwise, use a default (meeples, of course).
urlPrefix = 'https://abotars.jitsi.net/meeple/';
urlSuffix = '';
}
}
@ -223,26 +223,3 @@ function _getAllParticipants(stateful) {
? stateful
: toState(stateful)['features/base/participants'] || []);
}
/**
* Gets the initials from a name, assuming a westernized name.
*
* @param {string} name - The name from which to parse initials.
* @private
* @returns {string}
*/
function _getInitials(name) {
if (!name) {
return '';
}
const nameParts = name.toUpperCase().split(' ');
const firstName = nameParts[0];
let initials = firstName[0];
if (nameParts.length > 1) {
initials += nameParts[nameParts.length - 1];
}
return initials;
}