X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact%2FRelation.php;h=d68555eb3e854f2df8e5e6423dd47439e47176a1;hb=6dbbd081795fa1c8fe57db2248ac162efeeada88;hp=f0f24774ef61783d897ea8d3c35f48042cc8de91;hpb=3917c8ab5dcc045206a2add9927c4e01b235a724;p=friendica.git diff --git a/src/Model/Contact/Relation.php b/src/Model/Contact/Relation.php index f0f24774ef..d68555eb3e 100644 --- a/src/Model/Contact/Relation.php +++ b/src/Model/Contact/Relation.php @@ -1,6 +1,6 @@ $url]); return; } if (!self::isDiscoverable($url, $contact)) { + Logger::info('Contact is not discoverable', ['url' => $url]); return; } $uid = User::getIdForURL($url); if (!empty($uid)) { - // Fetch the followers/followings locally + Logger::info('Fetch the followers/followings locally', ['url' => $url]); $followers = self::getContacts($uid, [Contact::FOLLOWER, Contact::FRIEND]); $followings = self::getContacts($uid, [Contact::SHARING, Contact::FRIEND]); - } else { + } elseif (!Contact::isLocal($url)) { + Logger::info('Fetch the followers/followings by polling the endpoints', ['url' => $url]); $apcontact = APContact::getByURL($url, false); if (!empty($apcontact['followers']) && is_string($apcontact['followers'])) { @@ -104,10 +107,14 @@ class Relation } else { $followings = []; } + } else { + Logger::notice('Contact seems to be local but could not be found here', ['url' => $url]); + $followers = []; + $followings = []; } if (empty($followers) && empty($followings)) { - DBA::update('contact', ['last-discovery' => DateTimeFormat::utcNow()], ['id' => $contact['id']]); + Contact::update(['last-discovery' => DateTimeFormat::utcNow()], ['id' => $contact['id']]); Logger::info('The contact does not offer discoverable data', ['id' => $contact['id'], 'url' => $url, 'network' => $contact['network']]); return; } @@ -155,7 +162,7 @@ class Relation DBA::delete('contact-relation', ['cid' => $target, 'follows' => false, 'last-interaction' => DBA::NULL_DATETIME]); } - DBA::update('contact', ['last-discovery' => DateTimeFormat::utcNow()], ['id' => $target]); + Contact::update(['last-discovery' => DateTimeFormat::utcNow()], ['id' => $target]); Logger::info('Contacts discovery finished', ['id' => $target, 'url' => $url, 'follower' => $follower_counter, 'following' => $following_counter]); return; }