Merge pull request #1668 from nextcloud/fix/noid/display-name

fix display_name
pull/1670/head
Maxence Lange 2023-03-16 16:51:33 -01:00 zatwierdzone przez GitHub
commit 8f688d7390
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -420,6 +420,10 @@ class Person extends ACore implements IQueryRow, JsonSerializable {
* @return string
*/
public function getName(): string {
if ($this->name === '') {
return $this->preferredUsername;
}
return $this->name;
}
@ -781,7 +785,7 @@ class Person extends ACore implements IQueryRow, JsonSerializable {
'id' => (string)$this->getNid(),
'username' => $this->getPreferredUsername(),
'acct' => $this->isLocal() ? $this->getPreferredUsername() : $this->getAccount(),
'display_name' => $this->getDisplayName(),
'display_name' => $this->getName(),
'locked' => $this->isLocked(),
'bot' => $this->isBot(),
'discoverable' => $this->isDiscoverable(),