From 9f2d3e6f889c5c01257db74b5172b7bd1f49a39c Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 4 Sep 2022 07:15:04 +0000 Subject: [PATCH] Use AP data when possible --- src/Model/FContact.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/FContact.php b/src/Model/FContact.php index 8bc696a46..62f2f9836 100644 --- a/src/Model/FContact.php +++ b/src/Model/FContact.php @@ -96,7 +96,12 @@ class FContact $uriid = ItemURI::insert(['uri' => $arr['url'], 'guid' => $arr['guid']]); $contact = Contact::getByUriId($uriid, ['id']); - if (!empty($contact['id'])) { + $apcontact = APContact::getByURL($arr['url'], false); + if (!empty($apcontact)) { + $interacted = $apcontact['following_count']; + $interacting = $apcontact['followers_count']; + $posts = $apcontact['statuses_count']; + } elseif (!empty($contact['id'])) { $last_interaction = DateTimeFormat::utc('now - 180 days'); $interacted = DBA::count('contact-relation', ["`cid` = ? AND NOT `follows` AND `last-interaction` > ?", $contact['id'], $last_interaction]);