Use central function to fetch the global directory

This commit is contained in:
Michael 2022-04-26 18:33:58 +00:00
parent 478ee7b6fc
commit 171354181d
13 changed files with 24 additions and 14 deletions

View file

@ -2781,6 +2781,7 @@ class Contact
self::remove($contact['id']);
} else {
DI::logger()->info('Couldn\'t remove follower because of invalid contact array', ['contact' => $contact, 'callstack' => System::callstack()]);
return;
}
$cdata = Contact::getPublicAndUserContactID($contact['id'], $contact['uid']);

View file

@ -30,6 +30,7 @@ use Friendica\Core\Hook;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Search;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
@ -1287,7 +1288,7 @@ class User
$profile = DBA::selectFirst('profile', ['net-publish'], ['uid' => $register['uid']]);
if (DBA::isResult($profile) && $profile['net-publish'] && DI::config()->get('system', 'directory')) {
if (DBA::isResult($profile) && $profile['net-publish'] && Search::getGlobalDirectory()) {
$url = DI::baseUrl() . '/profile/' . $user['nickname'];
Worker::add(PRIORITY_LOW, "Directory", $url);
}