mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-23 22:36:01 +08:00
Improved sample of NextCloud Contacts Suggestions for #96
This commit is contained in:
parent
c3a95db495
commit
a6d5f6ad91
2 changed files with 8 additions and 6 deletions
|
@ -12,7 +12,7 @@ class NextcloudContactsSuggestions implements \RainLoop\Providers\Suggestions\IS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$sQuery = \trim($sQuery);
|
$sQuery = \trim($sQuery);
|
||||||
if ('' === $sQuery || !NextcloudPlugin::IsIntegrated()) {
|
if ('' === $sQuery) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,12 +36,14 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
*/
|
*/
|
||||||
public function MainFabrica(string $sName, &$mResult)
|
public function MainFabrica(string $sName, &$mResult)
|
||||||
{
|
{
|
||||||
if ('suggestions' === $sName) {
|
if (static::isLoggedIn()) {
|
||||||
if (!\is_array($mResult)) {
|
if ('suggestions' === $sName) {
|
||||||
$mResult = array();
|
if (!\is_array($mResult)) {
|
||||||
|
$mResult = array();
|
||||||
|
}
|
||||||
|
include_once __DIR__ . '/NextcloudContactsSuggestions.php';
|
||||||
|
$mResult[] = new NextcloudContactsSuggestions();
|
||||||
}
|
}
|
||||||
include_once __DIR__ . '/NextcloudContactsSuggestions.php';
|
|
||||||
$mResult[] = new NextcloudContactsSuggestions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue