Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Settings) use a proper UUID rather than hand-rolling it #2039

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions modules/settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { jitsiLocalStorage } from '@jitsi/js-utils';
import { getLogger } from '@jitsi/logger';

const logger = getLogger(__filename);
import { v4 as uuidv4 } from 'uuid';

import UsernameGenerator from '../util/UsernameGenerator';

const logger = getLogger(__filename);

let _callStatsUserName;

let _machineId;
Expand Down Expand Up @@ -106,23 +107,9 @@ function generateCallStatsUserName() {
* @returns {string} random unique id
*/
function generateJitsiMeetId() {
const jitsiMeetId = generateUniqueId();
const jitsiMeetId = uuidv4();

logger.log('generated id', jitsiMeetId);

return jitsiMeetId;
}

/**
*
*/
function generateUniqueId() {
return _p8() + _p8() + _p8() + _p8();
}

/**
*
*/
function _p8() {
return `${Math.random().toString(16)}000000000`.substr(2, 8);
}