Merge pull request #7929 from annando/apcontact-data
APContact: Added follower count, following count and count of posts
This commit is contained in:
commit
d994c91f38
3 changed files with 36 additions and 3 deletions
|
@ -203,6 +203,33 @@ 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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To-Do
|
||||
|
||||
// Unhandled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue