From 852924799f6779195ca457296d94e982d41672fa Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Mon, 20 Oct 2014 16:10:11 +0200 Subject: [PATCH] isSubscribed and hasBlocked need instance of Profile, not User used by actions/apifriendshipsshow.php --- lib/apiaction.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 lib/apiaction.php diff --git a/lib/apiaction.php b/lib/apiaction.php old mode 100644 new mode 100755 index b55647e445..4b4c94aed9 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -580,13 +580,16 @@ class ApiAction extends Action { $details = array(); + $source_profile = $source->getProfile(); + $target_profile = $target->getProfile(); + $details['screen_name'] = $source->nickname; - $details['followed_by'] = $target->isSubscribed($source); - $details['following'] = $source->isSubscribed($target); + $details['followed_by'] = $target->isSubscribed($source_profile); + $details['following'] = $source->isSubscribed($target_profile); $notifications = false; - if ($source->isSubscribed($target)) { + if ($source->isSubscribed($target_profile)) { $sub = Subscription::pkeyGet(array('subscriber' => $source->id, 'subscribed' => $target->id)); @@ -596,7 +599,7 @@ class ApiAction extends Action } $details['notifications_enabled'] = $notifications; - $details['blocking'] = $source->hasBlocked($target); + $details['blocking'] = $source->hasBlocked($target_profile); $details['id'] = intval($source->id); return $details; -- 2.39.5