зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #6743 from nextcloud/feature/6723/attributes-in-search
Add attributes in search results
This commit is contained in:
Коммит
9baa2fd20c
|
@ -141,7 +141,7 @@ class ConversationSearch implements IProvider {
|
|||
$iconClass = 'conversation-icon icon-contacts';
|
||||
}
|
||||
|
||||
$result[] = new SearchResultEntry(
|
||||
$entry = new SearchResultEntry(
|
||||
$icon,
|
||||
$room->getDisplayName($user->getUID()),
|
||||
'',
|
||||
|
@ -149,6 +149,10 @@ class ConversationSearch implements IProvider {
|
|||
$iconClass,
|
||||
true
|
||||
);
|
||||
|
||||
$entry->addAttribute('conversation', $room->getToken());
|
||||
|
||||
$result[] = $entry;
|
||||
}
|
||||
|
||||
return SearchResult::complete(
|
||||
|
|
|
@ -206,7 +206,7 @@ class MessageSearch implements IProvider {
|
|||
$subline = '{user}';
|
||||
}
|
||||
|
||||
return new SearchResultEntry(
|
||||
$entry = new SearchResultEntry(
|
||||
$iconUrl,
|
||||
str_replace(
|
||||
['{user}', '{conversation}'],
|
||||
|
@ -218,5 +218,10 @@ class MessageSearch implements IProvider {
|
|||
'icon-talk', // $iconClass,
|
||||
true
|
||||
);
|
||||
|
||||
$entry->addAttribute('conversation', $room->getToken());
|
||||
$entry->addAttribute('messageId', $comment->getId());
|
||||
|
||||
return $entry;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче