diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-12 09:04:13 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-03-12 09:48:14 +0000 |
commit | 3efb2d2208a8cd1b217e9ebcf562ba4553abede7 (patch) | |
tree | 90eead9e832f1cafd109b6d62f479efb6c6e3784 /apps/provisioning_api/lib/Controller/UsersController.php | |
parent | 6e2f7ddc7ae031d52853943c2f5fa46e85681892 (diff) | |
download | nextcloud-server-3efb2d2208a8cd1b217e9ebcf562ba4553abede7.tar.gz nextcloud-server-3efb2d2208a8cd1b217e9ebcf562ba4553abede7.zip |
Only clear known users when we had at least one phonebook entry
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/provisioning_api/lib/Controller/UsersController.php')
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index f1d03a53fc5..db4138054e7 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -239,9 +239,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) { @@ -262,6 +259,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)) { |