diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Collaboration/Reference/ReferenceManager.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/Collaboration/Reference/ReferenceManager.php b/lib/private/Collaboration/Reference/ReferenceManager.php index 5db30a50ea6..52f09d3a879 100644 --- a/lib/private/Collaboration/Reference/ReferenceManager.php +++ b/lib/private/Collaboration/Reference/ReferenceManager.php @@ -244,15 +244,15 @@ class ReferenceManager implements IReferenceManager { */ public function touchProvider(string $userId, string $providerId, ?int $timestamp = null): bool { $providers = $this->getDiscoverableProviders(); - $providerIds = array_map(static function (IDiscoverableReferenceProvider $provider) { - return $provider->getId(); - }, $providers); - if (array_search($providerId, $providerIds, true) !== false) { - $configKey = 'provider-last-use_' . $providerId; + $matchingProviders = array_filter($providers, static function (IDiscoverableReferenceProvider $provider) use ($providerId) { + return $provider->getId() === $providerId; + }); + if (!empty($matchingProviders)) { if ($timestamp === null) { $timestamp = time(); } + $configKey = 'provider-last-use_' . $providerId; $this->config->setUserValue($userId, 'references', $configKey, (string) $timestamp); return true; } |