fix(avatar) remove participant's "avatarID"

Through several avatar work iterations it's no longer used.
This commit is contained in:
Saúl Ibarra Corretgé 2020-10-09 14:19:56 +02:00 committed by Saúl Ibarra Corretgé
parent e67c08d837
commit c5f6df5210
9 changed files with 1 additions and 48 deletions

View File

@ -24,7 +24,6 @@ import {
reloadWithStoredParams reloadWithStoredParams
} from './react/features/app/actions'; } from './react/features/app/actions';
import { import {
AVATAR_ID_COMMAND,
AVATAR_URL_COMMAND, AVATAR_URL_COMMAND,
EMAIL_COMMAND, EMAIL_COMMAND,
authStatusChanged, authStatusChanged,
@ -169,7 +168,6 @@ window.JitsiMeetScreenObtainer = {
* Known custom conference commands. * Known custom conference commands.
*/ */
const commands = { const commands = {
AVATAR_ID: AVATAR_ID_COMMAND,
AVATAR_URL: AVATAR_URL_COMMAND, AVATAR_URL: AVATAR_URL_COMMAND,
CUSTOM_ROLE: 'custom-role', CUSTOM_ROLE: 'custom-role',
EMAIL: EMAIL_COMMAND, EMAIL: EMAIL_COMMAND,
@ -2136,16 +2134,6 @@ export default {
})); }));
}); });
room.addCommandListener(this.commands.defaults.AVATAR_ID,
(data, from) => {
APP.store.dispatch(
participantUpdated({
conference: room,
id: from,
avatarID: data.value
}));
});
APP.UI.addListener(UIEvents.NICKNAME_CHANGED, APP.UI.addListener(UIEvents.NICKNAME_CHANGED,
this.changeLocalDisplayName.bind(this)); this.changeLocalDisplayName.bind(this));

View File

@ -52,7 +52,6 @@ import {
SET_START_MUTED_POLICY SET_START_MUTED_POLICY
} from './actionTypes'; } from './actionTypes';
import { import {
AVATAR_ID_COMMAND,
AVATAR_URL_COMMAND, AVATAR_URL_COMMAND,
EMAIL_COMMAND, EMAIL_COMMAND,
JITSI_CONFERENCE_URL_KEY JITSI_CONFERENCE_URL_KEY
@ -198,13 +197,6 @@ function _addConferenceListeners(conference, dispatch) {
botType botType
}))); })));
conference.addCommandListener(
AVATAR_ID_COMMAND,
(data, id) => dispatch(participantUpdated({
conference,
id,
avatarID: data.value
})));
conference.addCommandListener( conference.addCommandListener(
AVATAR_URL_COMMAND, AVATAR_URL_COMMAND,
(data, id) => dispatch(participantUpdated({ (data, id) => dispatch(participantUpdated({

View File

@ -1,10 +1,3 @@
/**
* The command type for updating a participant's avatar ID.
*
* @type {string}
*/
export const AVATAR_ID_COMMAND = 'avatar-id';
/** /**
* The command type for updating a participant's avatar URL. * The command type for updating a participant's avatar URL.
* *

View File

@ -14,7 +14,6 @@ import { toState } from '../redux';
import { safeDecodeURIComponent } from '../util'; import { safeDecodeURIComponent } from '../util';
import { import {
AVATAR_ID_COMMAND,
AVATAR_URL_COMMAND, AVATAR_URL_COMMAND,
EMAIL_COMMAND, EMAIL_COMMAND,
JITSI_CONFERENCE_URL_KEY JITSI_CONFERENCE_URL_KEY
@ -316,16 +315,12 @@ export function sendLocalParticipant(
setDisplayName: Function, setDisplayName: Function,
setLocalParticipantProperty: Function }) { setLocalParticipantProperty: Function }) {
const { const {
avatarID,
avatarURL, avatarURL,
email, email,
features, features,
name name
} = getLocalParticipant(stateful); } = getLocalParticipant(stateful);
avatarID && conference.sendCommand(AVATAR_ID_COMMAND, {
value: avatarID
});
avatarURL && conference.sendCommand(AVATAR_URL_COMMAND, { avatarURL && conference.sendCommand(AVATAR_URL_COMMAND, {
value: avatarURL value: avatarURL
}); });

View File

@ -283,7 +283,6 @@ function _localParticipantJoined({ getState, dispatch }, next, action) {
const settings = getState()['features/base/settings']; const settings = getState()['features/base/settings'];
dispatch(localParticipantJoined({ dispatch(localParticipantJoined({
avatarID: settings.avatarID,
avatarURL: settings.avatarURL, avatarURL: settings.avatarURL,
email: settings.email, email: settings.email,
name: settings.displayName name: settings.displayName

View File

@ -181,7 +181,6 @@ function _participant(state: Object = {}, action) {
*/ */
function _participantJoined({ participant }) { function _participantJoined({ participant }) {
const { const {
avatarID,
avatarURL, avatarURL,
botType, botType,
connectionStatus, connectionStatus,
@ -211,7 +210,6 @@ function _participantJoined({ participant }) {
} }
return { return {
avatarID,
avatarURL, avatarURL,
botType, botType,
conference, conference,

View File

@ -5,7 +5,6 @@
* type: SETTINGS_UPDATED, * type: SETTINGS_UPDATED,
* settings: { * settings: {
* audioOutputDeviceId: string, * audioOutputDeviceId: string,
* avatarID: string,
* avatarURL: string, * avatarURL: string,
* cameraDeviceId: string, * cameraDeviceId: string,
* displayName: string, * displayName: string,

View File

@ -8,7 +8,6 @@ import { SETTINGS_UPDATED } from './actionTypes';
* type: SETTINGS_UPDATED, * type: SETTINGS_UPDATED,
* settings: { * settings: {
* audioOutputDeviceId: string, * audioOutputDeviceId: string,
* avatarID: string,
* avatarURL: string, * avatarURL: string,
* cameraDeviceId: string, * cameraDeviceId: string,
* displayName: string, * displayName: string,

View File

@ -1,7 +1,6 @@
// @flow // @flow
import { jitsiLocalStorage } from '@jitsi/js-utils'; import { jitsiLocalStorage } from '@jitsi/js-utils';
import { randomHexString } from '@jitsi/js-utils/random';
import _ from 'lodash'; import _ from 'lodash';
import { APP_WILL_MOUNT } from '../app/actionTypes'; import { APP_WILL_MOUNT } from '../app/actionTypes';
@ -19,7 +18,6 @@ import logger from './logger';
*/ */
const DEFAULT_STATE = { const DEFAULT_STATE = {
audioOutputDeviceId: undefined, audioOutputDeviceId: undefined,
avatarID: undefined,
avatarURL: undefined, avatarURL: undefined,
cameraDeviceId: undefined, cameraDeviceId: undefined,
disableCallIntegration: undefined, disableCallIntegration: undefined,
@ -126,24 +124,16 @@ function _initSettings(featureState) {
// jibri, and remove the old settings.js values. // jibri, and remove the old settings.js values.
const savedDisplayName = jitsiLocalStorage.getItem('displayname'); const savedDisplayName = jitsiLocalStorage.getItem('displayname');
const savedEmail = jitsiLocalStorage.getItem('email'); const savedEmail = jitsiLocalStorage.getItem('email');
let avatarID = _.escape(jitsiLocalStorage.getItem('avatarId'));
// The helper _.escape will convert null to an empty strings. The empty // The helper _.escape will convert null to an empty strings. The empty
// string will be saved in settings. On app re-load, because an empty string // string will be saved in settings. On app re-load, because an empty string
// is a defined value, it will override any value found in local storage. // is a defined value, it will override any value found in local storage.
// The workaround is sidestepping _.escape when the value is not set in // The workaround is sidestepping _.escape when the value is not set in
// local storage. // local storage.
const displayName const displayName = savedDisplayName === null ? undefined : _.escape(savedDisplayName);
= savedDisplayName === null ? undefined : _.escape(savedDisplayName);
const email = savedEmail === null ? undefined : _.escape(savedEmail); const email = savedEmail === null ? undefined : _.escape(savedEmail);
if (!avatarID) {
// if there is no avatar id, we generate a unique one and use it forever
avatarID = randomHexString(32);
}
settings = assignIfDefined({ settings = assignIfDefined({
avatarID,
displayName, displayName,
email email
}, settings); }, settings);