diff --git a/lib/Chat/AutoComplete/SearchPlugin.php b/lib/Chat/AutoComplete/SearchPlugin.php index 2d077880a5fc..68e8d27d2c92 100644 --- a/lib/Chat/AutoComplete/SearchPlugin.php +++ b/lib/Chat/AutoComplete/SearchPlugin.php @@ -71,7 +71,11 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b if ($this->room->getObjectType() === 'file') { $usersWithFileAccess = $this->util->getUsersWithAccessFile($this->room->getObjectId()); if (!empty($usersWithFileAccess)) { - $this->searchUsers($search, $usersWithFileAccess, $searchResult); + $users = []; + foreach ($usersWithFileAccess as $userId) { + $users[$userId] = $this->userManager->getDisplayName($userId) ?? $userId; + } + $this->searchUsers($search, $users, $searchResult); } } diff --git a/lib/Files/Util.php b/lib/Files/Util.php index 9c5f73697aa9..6755d298db27 100644 --- a/lib/Files/Util.php +++ b/lib/Files/Util.php @@ -48,6 +48,9 @@ public function __construct( ) { } + /** + * @return string[] + */ public function getUsersWithAccessFile(string $fileId): array { if (!isset($this->accessLists[$fileId])) { $nodes = $this->rootFolder->getById((int) $fileId);