mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-04-27 06:24:52 +02:00
Replaced getAvatarURL from js-utils
This commit is contained in:
parent
c0f5d0e208
commit
541cfd3401
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import { getAvatarURL } from '../utils';
|
import { getAvatarURL } from 'js-utils';
|
||||||
import { SET_EMAIL, SET_NAME } from './actionTypes';
|
import { SET_EMAIL, SET_NAME } from './actionTypes';
|
||||||
import { setAvatarURL } from './actions';
|
import { setAvatarURL } from './actions';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import { getAvatarURL } from '../utils';
|
import { getAvatarURL } from 'js-utils';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SET_AVATAR_URL,
|
SET_AVATAR_URL,
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import { shell } from 'electron';
|
import { shell } from 'electron';
|
||||||
import md5 from 'js-md5';
|
|
||||||
import config from '../config';
|
import config from '../config';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,35 +55,3 @@ export function normalizeServerURL(url: string) {
|
||||||
export function openExternalLink(link: string) {
|
export function openExternalLink(link: string) {
|
||||||
shell.openExternal(link);
|
shell.openExternal(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the Avatar URL to be used.
|
|
||||||
*
|
|
||||||
* @param {string} key - Unique key to generate Avatar URL.
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
export function getAvatarURL({ email, id }: {
|
|
||||||
email: string,
|
|
||||||
id: string
|
|
||||||
}) {
|
|
||||||
let key = email || id;
|
|
||||||
let urlPrefix;
|
|
||||||
let urlSuffix;
|
|
||||||
|
|
||||||
// If the ID looks like an e-mail address, we'll use Gravatar because it
|
|
||||||
// supports e-mail addresses.
|
|
||||||
if (key && key.indexOf('@') > 0) {
|
|
||||||
|
|
||||||
// URL prefix and suffix of gravatar service.
|
|
||||||
urlPrefix = 'https://www.gravatar.com/avatar/';
|
|
||||||
urlSuffix = '?d=wavatar&size=200';
|
|
||||||
} else {
|
|
||||||
key = id;
|
|
||||||
|
|
||||||
// Otherwise, use a default (meeples, of course).
|
|
||||||
urlPrefix = 'https://abotars.jitsi.net/meeple/';
|
|
||||||
urlSuffix = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return urlPrefix + md5.hex(key.trim().toLowerCase()) + urlSuffix;
|
|
||||||
}
|
|
||||||
|
|
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -2363,6 +2363,11 @@
|
||||||
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
|
"integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"bowser": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-UXti1JB6oK8hO983AImunnV6j/fqAEeDlPXh99zhsP5g32oLbxJJ6qcOaUesR+tqqhnUVQHlRJyD0dfiV0Hxaw=="
|
||||||
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
@ -7321,6 +7326,13 @@
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
|
||||||
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls="
|
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls="
|
||||||
},
|
},
|
||||||
|
"js-utils": {
|
||||||
|
"version": "github:jitsi/js-utils#0c53500a5120be2aa3fc590f0f932a0d4771920f",
|
||||||
|
"requires": {
|
||||||
|
"bowser": "1.9.1",
|
||||||
|
"js-md5": "0.7.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "3.7.0",
|
"version": "3.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz",
|
||||||
|
|
|
@ -45,8 +45,8 @@
|
||||||
"electron-window-state": "4.1.1",
|
"electron-window-state": "4.1.1",
|
||||||
"history": "4.7.2",
|
"history": "4.7.2",
|
||||||
"jitsi-meet-electron-utils": "github:jitsi/jitsi-meet-electron-utils#1972c3bf0884ace68eb496894dabae593d6dbf49",
|
"jitsi-meet-electron-utils": "github:jitsi/jitsi-meet-electron-utils#1972c3bf0884ace68eb496894dabae593d6dbf49",
|
||||||
"js-md5": "0.7.3",
|
|
||||||
"mousetrap": "1.6.2",
|
"mousetrap": "1.6.2",
|
||||||
|
"js-utils": "github:jitsi/js-utils#0c53500a5120be2aa3fc590f0f932a0d4771920f",
|
||||||
"react": "16.3.2",
|
"react": "16.3.2",
|
||||||
"react-dom": "16.3.2",
|
"react-dom": "16.3.2",
|
||||||
"react-redux": "5.0.7",
|
"react-redux": "5.0.7",
|
||||||
|
|
|
@ -12,7 +12,7 @@ const commonConfig = {
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
exclude: /(node_modules)/,
|
exclude: /node_modules(?!\/js-utils)/,
|
||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
presets: [
|
presets: [
|
||||||
|
|
Loading…
Reference in a new issue