fix display_name

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/1668/head
Maxence Lange 2023-03-16 16:13:50 -01:00
rodzic c09c8f3258
commit 58aab00cb3
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(),