From a6d5f6ad91d5d9d999ab0d49b1c1e84ccf539228 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 10 Oct 2022 18:41:15 +0200 Subject: [PATCH] Improved sample of NextCloud Contacts Suggestions for #96 --- plugins/nextcloud/NextCloudContactsSuggestions.php | 2 +- plugins/nextcloud/index.php | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/nextcloud/NextCloudContactsSuggestions.php b/plugins/nextcloud/NextCloudContactsSuggestions.php index 4e6061ff5..c6451344c 100644 --- a/plugins/nextcloud/NextCloudContactsSuggestions.php +++ b/plugins/nextcloud/NextCloudContactsSuggestions.php @@ -12,7 +12,7 @@ class NextcloudContactsSuggestions implements \RainLoop\Providers\Suggestions\IS try { $sQuery = \trim($sQuery); - if ('' === $sQuery || !NextcloudPlugin::IsIntegrated()) { + if ('' === $sQuery) { return []; } diff --git a/plugins/nextcloud/index.php b/plugins/nextcloud/index.php index d58d31051..731d5b663 100644 --- a/plugins/nextcloud/index.php +++ b/plugins/nextcloud/index.php @@ -36,12 +36,14 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin */ public function MainFabrica(string $sName, &$mResult) { - if ('suggestions' === $sName) { - if (!\is_array($mResult)) { - $mResult = array(); + if (static::isLoggedIn()) { + if ('suggestions' === $sName) { + if (!\is_array($mResult)) { + $mResult = array(); + } + include_once __DIR__ . '/NextcloudContactsSuggestions.php'; + $mResult[] = new NextcloudContactsSuggestions(); } - include_once __DIR__ . '/NextcloudContactsSuggestions.php'; - $mResult[] = new NextcloudContactsSuggestions(); } } }