From b161bd1dfa8522c742b2f8d1d34cbad2d27466bc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 21 Jan 2019 11:37:05 -0500 Subject: [PATCH] Improve get_responses() prototype --- include/conversation.php | 2 +- mod/photos.php | 2 +- src/Object/Post.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index e6c787915..682bc1455 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1464,7 +1464,7 @@ function render_location_dummy(array $item) { } } -function get_responses(array $conv_responses, array $response_verbs, $ob, array $item) { +function get_responses(array $conv_responses, array $response_verbs, array $item, Post $ob = null) { $ret = []; foreach ($response_verbs as $v) { $ret[$v] = []; diff --git a/mod/photos.php b/mod/photos.php index 710a3873e..137e0adb5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1564,7 +1564,7 @@ function photos_content(App $a) } $response_verbs = ['like']; $response_verbs[] = 'dislike'; - $responses = get_responses($conv_responses, $response_verbs, '', $link_item); + $responses = get_responses($conv_responses, $response_verbs, $link_item); $paginate = $pager->renderFull($total); } diff --git a/src/Object/Post.php b/src/Object/Post.php index 2d52f4244..c9e5cddb6 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -250,7 +250,7 @@ class Post extends BaseObject } } - $responses = get_responses($conv_responses, $response_verbs, $this, $item); + $responses = get_responses($conv_responses, $response_verbs, $item, $this); foreach ($response_verbs as $value => $verbs) { $responses[$verbs]['output'] = !empty($conv_responses[$verbs][$item['uri']]) ? format_like($conv_responses[$verbs][$item['uri']], $conv_responses[$verbs][$item['uri'] . '-l'], $verbs, $item['uri']) : '';