Refactor builtin_activity_puller() and format_like()

- Simplify output array
- Rename format_like() to format_activity()
- Remove duplicate parameters in format_activity()
This commit is contained in:
Hypolite Petovan 2020-11-21 11:08:44 -05:00
parent e6362c4923
commit 8b3ab4e6bb
3 changed files with 57 additions and 62 deletions

View file

@ -280,8 +280,8 @@ class Post
$responses = [];
foreach ($response_verbs as $value => $verb) {
$responses[$verb] = [
'self' => $conv_responses[$verb][$item['uri'] . '-self'] ?? 0,
'output' => !empty($conv_responses[$verb][$item['uri']]) ? format_like($conv_responses[$verb][$item['uri']], $conv_responses[$verb][$item['uri'] . '-l'], $verb, $item['uri']) : '',
'self' => $conv_responses[$verb][$item['uri']]['self'] ?? 0,
'output' => !empty($conv_responses[$verb][$item['uri']]) ? format_activity($conv_responses[$verb][$item['uri']]['links'], $verb, $item['uri']) : '',
];
}