Browse Source

Only clear known users when we had at least one phonebook entry

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v22.0.0beta1
Joas Schilling 3 years ago
parent
commit
5c3551cf2f
No account linked to committer's email address
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      apps/provisioning_api/lib/Controller/UsersController.php

+ 3
- 3
apps/provisioning_api/lib/Controller/UsersController.php View File

@@ -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…
Cancel
Save