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.
This commit is contained in:
Leonard Kim 2017-12-28 11:27:23 -08:00 committed by yanas
parent e217c172f8
commit 698ec1e2d7
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;
}