Doesnt show user^s real name

hi, a have server on debian installed a few days ago throw snap. everythins works fine but there is one moment. ive configured server to show names of users at contact list. but for some users i cant see name only login. how to fix?

Hi!

Check this option:
User Real Name

Ive enabled this option Use Real Name:
but somtimes it shows only login not real name. not for every users. somebody sees only login for one user and somebody sees only login for deferent user.

forgot to say real names we use in russian, logins in english. maybe its important.

that’s important to note :slight_smile:

Can you reproduce this on a fresh new install and document the steps?

This is crucial so we can deliver this environment for our devs.

ok ill try. maybe ill use debian 11 or new version of ubuntu.

1 Like

Ничего таки не решилось? У меня такая же проблема.

к сожалению пока нет, буду поднимать на свежей дебиан если тоже самое то напишу сюда.

Привет! Не возникали проблемы с отправкой нескольких файлов, а именно название файлов остаются как у первого файла? То есть 3 файла могут отправится с 1 наименованием.

hi, ive installed new server on debian 11 with snap, and then switched on use real names. all the same

Sandiego, can you provide the exact steps to reproduce this?

I also shared this with our team, and looks like they have seen a similar behavior but were not able to replicate it consistently.

it happens randomly. ive installed it, created users, swiched on use real names, and then started testing. I noticed that if real name in russian did not appear, when new conversation starts, it will not happen even if you reboot server or client . but if I make some changes in real name for this user, name appears normally

1 Like

Попробуй окно чата ресайзить, на большом размере имена нормально, а на маленьком переходят в ники?

Same story.
Some users are shown as logins.
It happend with v3 for new user at some point. And remained after update to v4 and v5.
These users see some old users as logins too. Ldap sync does not help.
Can be cured by editing name in RC.

A tiny Powershell script to rewrite all names :stuck_out_tongue:
You’ll need admin id and token from /account/tokens
You’ll need all three files in the same folder.
Change CSV values to yours. This CSV uses ‘;’ as delimeters.
Remove ‘pause’ if no errors.

 $list=get-RCusers.ps1 -Servername rocketchat|?{$_.lastlogin}
 $list|%{$rcuser=$_;'__',$rcuser.name|%{ .\set-RCuser.ps1 -Servername rocketchat -UserID $rcuser._id -newname $_;pause}}

an example of a very unsafe rc-auth.csv

name;domain;id;token
rocket-test;example.com;4AAdsafaHasdfSfBKasdfa11;Ykaasdf3sazMoKtwSQVas@$asdkjhlS0MlZsBeePJAadfJacU2WLkyx

set-RCuser.ps1 to set new name
#https://developer.rocket.chat/reference/api/rest-api/endpoints/core-endpoints/users-endpoints/update-user
param([Parameter(Mandatory=$True)][string]$UserID,[Parameter(Mandatory=$True)][string]$Servername,[string]$domain,[string]$newname)
#auth block#
$script_fullname = $MyInvocation.MyCommand.Definition	
$script_folder = split-path -parent $script_fullname
$authpath="$script_folder\rc-auth.csv"

if (!$domain){$serverauth=import-csv $authpath -Delimiter ";" |?{$_.name -eq $servername}}
  else       {$serverauth=import-csv $authpath -Delimiter ";" |?{($_.name -eq $servername) -and ($_.domain -eq $domain) }}

$connect_url = "https://$($serverauth.name).$($serverauth.domain)"
$connect_id  = $serverauth.id
$connect_token = $serverauth.token

if (!$connect_url -or !$connect_id -or !$connect_token) {write-error "check connection parameters";return}
#--end of auth block --

$Headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$Headers.Add("X-Auth-Token", $connect_token)
$Headers.Add("X-User-ID", $connect_id)

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# $username = $username.ToLower().Trim()
$url = "$connect_url/api/v1/users.update"
$body=@{userId=$UserID; data=@{ name=$newname }}| ConvertTo-Json

$response = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers $Headers -Method POST -body $body  -ContentType "application/json; charset=utf-8"

if ($response -ne $null) {
    $reader = New-Object System.IO.StreamReader($response.RawContentStream, [System.Text.Encoding]::UTF8)
    $result = ($reader.ReadToEnd()|Convertfrom-Json).user
    return $result
}else { write-host "No such user or bad request" }
get-RCusers.ps1 to list them all
param([Parameter(Mandatory=$True)][string]$Servername,[string]$domain)
#auth block#
$script_fullname = $MyInvocation.MyCommand.Definition	
$script_folder = split-path -parent $script_fullname
$authpath="$script_folder\rc-auth.csv"

if (!$domain){$serverauth=import-csv $authpath -Delimiter ";" |?{$_.name -eq $servername}}
  else       {$serverauth=import-csv $authpath -Delimiter ";" |?{($_.name -eq $servername) -and ($_.domain -eq $domain) }}

$connect_url = "https://$($serverauth.name).$($serverauth.domain)"
$connect_id  = $serverauth.id
$connect_token = $serverauth.token

if (!$connect_url -or !$connect_id -or !$connect_token) {write-error "check connection parameters";return}
#--end of auth block --

$Headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$Headers.Add("X-Auth-Token", $connect_token)
$Headers.Add("X-User-ID", $connect_id)

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$url = "$connect_url/api/v1/users.list"

#api returns users in pages
$user_list=@()
$user_page=100 #100 maximium
$user_offset=0
do {
	$response = Invoke-WebRequest -Uri "$($url)?count=$($user_page)&offset=$($user_offset)" -UseBasicParsing -Headers $Headers
	$reader = New-Object System.IO.StreamReader($response.RawContentStream, [System.Text.Encoding]::UTF8)
	$result = ($reader.ReadToEnd()|Convertfrom-Json).users
	if ($result.count){
		$user_list+=$result
		$user_offset+=$result.count #correct no need for +/-1
	}
}while($result.count -eq $user_page)

return $user_list