Merge pull request #26080 from nextcloud/bugfix/noid/only-clear-known-users-when-we-had-at-least-one-phonebook-entry
Only clear known users when we had at least one phonebook entry
This commit is contained in:
commit
812bc83b56
|
@ -240,9 +240,6 @@ class UsersController extends AUserData {
|
|||
$user = $this->userSession->getUser();
|
||||
$knownTo = $user->getUID();
|
||||
|
||||
// Cleanup all previous entries and only allow new matches
|
||||
$this->knownUserService->deleteKnownTo($knownTo);
|
||||
|
||||
$normalizedNumberToKey = [];
|
||||
foreach ($search as $key => $phoneNumbers) {
|
||||
foreach ($phoneNumbers as $phone) {
|
||||
|
@ -263,6 +260,9 @@ class UsersController extends AUserData {
|
|||
return new DataResponse();
|
||||
}
|
||||
|
||||
// Cleanup all previous entries and only allow new matches
|
||||
$this->knownUserService->deleteKnownTo($knownTo);
|
||||
|
||||
$userMatches = $this->accountManager->searchUsers(IAccountManager::PROPERTY_PHONE, $phoneNumbers);
|
||||
|
||||
if (empty($userMatches)) {
|
||||
|
|
Loading…
Reference in New Issue