From ab7ec357cb932c62a8ab613e774425ce0cdf580d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 23 Mar 2019 10:01:25 -0400 Subject: [PATCH] Remove type parameter from api_get_last_status function prototype --- include/api.php | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/include/api.php b/include/api.php index 1bfc3f9d02..7bdab84d23 100644 --- a/include/api.php +++ b/include/api.php @@ -953,9 +953,9 @@ function api_account_verify_credentials($type) // - Adding last status if (!$skip_status) { - $last_status = api_get_last_status($user_info['pid'], $user_info['uid'], $type); - if ($last_status) { - $user_info['status'] = $last_status; + $item = api_get_last_status($user_info['pid'], $user_info['uid']); + if ($item) { + $user_info['status'] = api_format_item($item, $type); } } @@ -1265,11 +1265,10 @@ function api_status_show($type, $item_id) * * @param int $ownerId Public contact Id * @param int $uid User Id - * @param string $type Return format (atom, rss, xml, json) * @return array * @throws Exception */ -function api_get_last_status($ownerId, $uid, $type = 'json') +function api_get_last_status($ownerId, $uid) { $condition = [ 'owner-id' => $ownerId, @@ -1280,9 +1279,7 @@ function api_get_last_status($ownerId, $uid, $type = 'json') $item = api_get_item($condition); - $status_info = api_format_item($item, $type); - - return $status_info; + return $item; } /** @@ -1317,9 +1314,9 @@ function api_users_show($type) $user_info = api_get_user($a); - $lastStatus = api_get_last_status($user_info['pid'], $user_info['uid'], $type); - if ($lastStatus) { - $user_info['status'] = $lastStatus; + $item = api_get_last_status($user_info['pid'], $user_info['uid']); + if ($item) { + $user_info['status'] = api_format_item($item, $type); } // "uid" and "self" are only needed for some internal stuff, so remove it from here -- 2.39.5