mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat: override email, display name and avatar on mobile
Will override email, display name and avatar URL with the values provided in 'context.user' structure of the JWT token. Settings will no longer be used to retrieve local display name, email and avatar URL. Now those values will be obtained from the /features/base/participants Redux state. fix(jwt/middleware): use const for default name fix: wrong default display name on web ref(base/participants): remove getDisplayName functions ref(jwt): do not accept unknown user fields
This commit is contained in:
committed by
Lyubo Marinov
parent
0eddef4d62
commit
8a4e6a7ec0
@@ -1,11 +1,12 @@
|
||||
/* global APP, interfaceConfig */
|
||||
/* global interfaceConfig */
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { Dialog } from '../../base/dialog';
|
||||
import { translate } from '../../base/i18n';
|
||||
|
||||
import { getLocalParticipant } from '../../base/participants';
|
||||
import SpeakerStatsItem from './SpeakerStatsItem';
|
||||
import SpeakerStatsLabels from './SpeakerStatsLabels';
|
||||
|
||||
@@ -21,6 +22,12 @@ class SpeakerStats extends Component {
|
||||
* @static
|
||||
*/
|
||||
static propTypes = {
|
||||
/**
|
||||
* The display name for the local participant obtained from the Redux
|
||||
* store.
|
||||
*/
|
||||
_localDisplayName: PropTypes.string,
|
||||
|
||||
/**
|
||||
* The JitsiConference from which stats will be pulled.
|
||||
*/
|
||||
@@ -130,7 +137,7 @@ class SpeakerStats extends Component {
|
||||
const { t } = this.props;
|
||||
const meString = t('me');
|
||||
|
||||
displayName = APP.settings.getDisplayName();
|
||||
displayName = this.props._localDisplayName;
|
||||
displayName = displayName ? `${displayName} (${meString})`
|
||||
: meString;
|
||||
} else {
|
||||
@@ -149,4 +156,26 @@ class SpeakerStats extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default translate(SpeakerStats);
|
||||
/**
|
||||
* Maps (parts of) the Redux state to the associated SpeakerStats's props.
|
||||
*
|
||||
* @param {Object} state - The Redux state.
|
||||
* @private
|
||||
* @returns {{
|
||||
* _localDisplayName: string?
|
||||
* }}
|
||||
*/
|
||||
function _mapStateToProps(state) {
|
||||
const localParticipant = getLocalParticipant(state);
|
||||
|
||||
return {
|
||||
/**
|
||||
* The local display name.
|
||||
* @private
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
_localDisplayName: localParticipant && localParticipant.name
|
||||
};
|
||||
}
|
||||
|
||||
export default translate(connect(_mapStateToProps)(SpeakerStats));
|
||||
|
||||
Reference in New Issue
Block a user