Skip to content

Commit

Permalink
fixup! feat(chat): Autocomplete for mentions of federated users
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed Feb 15, 2024
1 parent fe093a4 commit a8bc489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Chat/AutoComplete/SearchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 3 additions & 0 deletions lib/Files/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a8bc489

Please sign in to comment.