mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
APContact: Added follower count, following count and count of posts
This commit is contained in:
parent
9c1f652008
commit
911a854255
3 changed files with 38 additions and 3 deletions
|
@ -203,6 +203,35 @@ class APContact extends BaseObject
|
|||
$apcontact['generator'] = JsonLD::fetchElement($compacted['as:generator'], 'as:name', '@value');
|
||||
}
|
||||
|
||||
if (!empty($apcontact['following'])) {
|
||||
$data = ActivityPub::fetchContent($apcontact['following']);
|
||||
if (!empty($data)) {
|
||||
if (!empty($data['totalItems'])) {
|
||||
$apcontact['following_count'] = $data['totalItems'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($apcontact['followers'])) {
|
||||
$data = ActivityPub::fetchContent($apcontact['followers']);
|
||||
if (!empty($data)) {
|
||||
if (!empty($data['totalItems'])) {
|
||||
$apcontact['followers_count'] = $data['totalItems'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($apcontact['outbox'])) {
|
||||
$data = ActivityPub::fetchContent($apcontact['outbox']);
|
||||
if (!empty($data)) {
|
||||
if (!empty($data['totalItems'])) {
|
||||
$apcontact['statuses_count'] = $data['totalItems'];
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
$apcontact['inbox'] = JsonLD::fetchElement($compacted, 'ldp:inbox', '@id');
|
||||
*/
|
||||
// To-Do
|
||||
|
||||
// Unhandled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue