]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
isSubscribed and hasBlocked need instance of Profile, not User
authorHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:10:11 +0000 (16:10 +0200)
committerHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:10:11 +0000 (16:10 +0200)
used by actions/apifriendshipsshow.php

lib/apiaction.php [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index b55647e..4b4c94a
@@ -580,13 +580,16 @@ class ApiAction extends Action
     {
         $details = array();
 
     {
         $details = array();
 
+               $source_profile = $source->getProfile();
+               $target_profile = $target->getProfile();                
+
         $details['screen_name'] = $source->nickname;
         $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;
 
 
         $notifications = false;
 
-        if ($source->isSubscribed($target)) {
+        if ($source->isSubscribed($target_profile)) {
             $sub = Subscription::pkeyGet(array('subscriber' =>
                 $source->id, 'subscribed' => $target->id));
 
             $sub = Subscription::pkeyGet(array('subscriber' =>
                 $source->id, 'subscribed' => $target->id));
 
@@ -596,7 +599,7 @@ class ApiAction extends Action
         }
 
         $details['notifications_enabled'] = $notifications;
         }
 
         $details['notifications_enabled'] = $notifications;
-        $details['blocking'] = $source->hasBlocked($target);
+        $details['blocking'] = $source->hasBlocked($target_profile);
         $details['id'] = intval($source->id);
 
         return $details;
         $details['id'] = intval($source->id);
 
         return $details;