]> git.mxchange.org Git - friendica.git/blob - src/Worker/UpdateServerDirectories.php
Don't add contacts when not needed
[friendica.git] / src / Worker / UpdateServerDirectories.php
1 <?php
2 /**
3  * @file src/Worker/UpdateServerDirectories.php
4  */
5 namespace Friendica\Worker;
6
7 use Friendica\Core\Config;
8 use Friendica\Core\Logger;
9 use Friendica\Model\GContact;
10 use Friendica\Protocol\PortableContact;
11
12 class UpdateServerDirectories
13 {
14         /**
15          * Query global servers for their users
16          */
17         public static function execute()
18         {
19                 if (Config::get('system', 'poco_discovery') == PortableContact::DISABLED) {
20                         return;
21                 }
22
23                 // Query Friendica and Hubzilla servers for their users
24                 PortableContact::discover();
25
26                 // Query GNU Social servers for their users ("statistics" addon has to be enabled on the GS server)
27                 if (!Config::get('system', 'ostatus_disabled')) {
28                         GContact::discoverGsUsers();
29                 }
30         }
31 }