Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Dec 10, 2024
1 parent 04810e8 commit 416b7be
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions plugin/Meet/api.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,27 @@ interfaceConfigOverwrite: {
});

api.addListener('participantJoined', (participant) => {
let nomeAtual = participant.displayName || "";
let currentName = participant.displayName || "";

// Verificar se é número de telefone (contendo apenas dígitos, parênteses e hífen)
const padraoTelefone = /^[0-9()\-\s]+$/;
if (padraoTelefone.test(nomeAtual)) {
// Mostrar somente os últimos 2 dígitos
nomeAtual = nomeAtual.slice(-2);
} else {
// Caso contrário, adicionar o prefixo "OK "
nomeAtual = "OK " + nomeAtual;
// Check if the name looks like a phone number (contains only digits, spaces, dashes, and parentheses)
const phonePattern = /^[0-9()\-\s]+$/;
if (phonePattern.test(currentName)) {
// Remove all non-numeric characters to standardize the phone number
const numbers = currentName.replace(/\D/g, '');

// Format the phone number to ** ****-**XX (last 2 digits visible)
if (numbers.length >= 4) {
currentName = `** ****-**${numbers.slice(-2)}`;
} else {
// If there are less than 4 digits, return a fallback
currentName = '**';
}
}

// Definir o novo nome para o participante local
api.executeCommand('displayName', nomeAtual);
// Set the new display name for the local participant
api.executeCommand('displayName', currentName);
});


<?php
if (!empty($rtmpLink) && !empty($_REQUEST['startLiveMeet'])) {
?>
Expand Down

0 comments on commit 416b7be

Please sign in to comment.