Merge pull request #8267 from nextcloud/8206_13
[stable13] Better result handling of email search
This commit is contained in:
commit
58cc34b816
|
@ -173,6 +173,8 @@ class MailPlugin implements ISearchPlugin {
|
|||
|
||||
if (!$this->shareeEnumeration) {
|
||||
$result['wide'] = [];
|
||||
} else {
|
||||
$result['wide'] = array_slice($result['wide'], $offset, $limit);
|
||||
}
|
||||
|
||||
if (!$searchResult->hasExactIdMatch($emailType) && filter_var($search, FILTER_VALIDATE_EMAIL)) {
|
||||
|
|
|
@ -102,6 +102,8 @@ class RemotePlugin implements ISearchPlugin {
|
|||
|
||||
if (!$this->shareeEnumeration) {
|
||||
$result['wide'] = [];
|
||||
} else {
|
||||
$result['wide'] = array_slice($result['wide'], $offset, $limit);
|
||||
}
|
||||
|
||||
if (!$searchResult->hasExactIdMatch($resultType) && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) {
|
||||
|
|
|
@ -103,7 +103,7 @@ class MailPluginTest extends TestCase {
|
|||
->with($searchTerm, ['EMAIL', 'FN'])
|
||||
->willReturn($contacts);
|
||||
|
||||
$moreResults = $this->plugin->search($searchTerm, 0, 0, $this->searchResult);
|
||||
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
||||
$result = $this->searchResult->asArray();
|
||||
|
||||
$this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
||||
|
@ -398,7 +398,7 @@ class MailPluginTest extends TestCase {
|
|||
return in_array($group, $userToGroupMapping[$userId]);
|
||||
});
|
||||
|
||||
$moreResults = $this->plugin->search($searchTerm, 0, 0, $this->searchResult);
|
||||
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
||||
$result = $this->searchResult->asArray();
|
||||
|
||||
$this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('emails')));
|
||||
|
|
|
@ -94,7 +94,7 @@ class RemotePluginTest extends TestCase {
|
|||
->with($searchTerm, ['CLOUD', 'FN'])
|
||||
->willReturn($contacts);
|
||||
|
||||
$moreResults = $this->plugin->search($searchTerm, 0, 0, $this->searchResult);
|
||||
$moreResults = $this->plugin->search($searchTerm, 2, 0, $this->searchResult);
|
||||
$result = $this->searchResult->asArray();
|
||||
|
||||
$this->assertSame($exactIdMatch, $this->searchResult->hasExactIdMatch(new SearchResultType('remotes')));
|
||||
|
|
Loading…
Reference in New Issue