X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FUpdateServerDirectory.php;h=21599b533e65c2a10d46ac22ee4a875c0fec0361;hb=018abb4d1dfbe0bf29b441dce281d89a437075b4;hp=2066ce7cb924e31255a97ac2a6ed0cb0e2f532a8;hpb=0c73531da1d93f218a47c798ae5db1d00144a7be;p=friendica.git diff --git a/src/Worker/UpdateServerDirectory.php b/src/Worker/UpdateServerDirectory.php index 2066ce7cb9..21599b533e 100644 --- a/src/Worker/UpdateServerDirectory.php +++ b/src/Worker/UpdateServerDirectory.php @@ -36,7 +36,6 @@ class UpdateServerDirectory */ public static function execute(array $gserver) { - $gserver = DBA::selectFirst('gserver', [], ['url' => $gserver['url']]); if ($gserver['directory-type'] == GServer::DT_MASTODON) { self::discoverMastodonDirectory($gserver); } elseif (!empty($gserver['poco'])) { @@ -61,8 +60,8 @@ class UpdateServerDirectory Logger::info('PoCo discovery started', ['poco' => $gserver['poco']]); $urls = []; - foreach ($contacts['entry'] as $entry) { - foreach ($entry['urls'] as $url_entry) { + foreach (array_column($contacts['entry'], 'urls') as $url_entries) { + foreach ($url_entries as $url_entry) { if (empty($url_entry['type']) || empty($url_entry['value'])) { continue; } @@ -72,7 +71,7 @@ class UpdateServerDirectory } } - $result = Contact::addContactsByArray($urls); + $result = Contact::addByUrls($urls); Logger::info('PoCo discovery ended', ['count' => $result['count'], 'added' => $result['added'], 'updated' => $result['updated'], 'poco' => $gserver['poco']]); } @@ -100,7 +99,7 @@ class UpdateServerDirectory } } - $result = Contact::addContactsByArray($urls); + $result = Contact::addByUrls($urls); Logger::info('Account discovery ended', ['count' => $result['count'], 'added' => $result['added'], 'updated' => $result['updated'], 'url' => $gserver['url']]); }