]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix issue with favorited/following always being set to false
authorZach Copley <zach@status.net>
Mon, 14 Dec 2009 18:16:45 +0000 (18:16 +0000)
committerZach Copley <zach@status.net>
Mon, 14 Dec 2009 19:25:51 +0000 (11:25 -0800)
lib/api.php
lib/apiauth.php

index eacb80dbea8495e74dacd607318db850125406b3..ae47434a50012bd79c68ab04b3fabd6945519f87 100644 (file)
@@ -53,13 +53,14 @@ if (!defined('STATUSNET')) {
 
 class ApiAction extends Action
 {
-     var $format   = null;
-     var $user     = null;
-     var $page     = null;
-     var $count    = null;
-     var $max_id   = null;
-     var $since_id = null;
-     var $since    = null;
+    var $format    = null;
+    var $user      = null;
+    var $auth_user = null;
+    var $page      = null;
+    var $count     = null;
+    var $max_id    = null;
+    var $since_id  = null;
+    var $since     = null;
 
     /**
      * Initialization.
@@ -188,13 +189,14 @@ class ApiAction extends Action
         $twitter_user['following'] = false;
         $twitter_user['notifications'] = false;
 
-        if (isset($apidata['user'])) {
+        if (isset($this->auth_user)) {
 
-            $twitter_user['following'] = $apidata['user']->isSubscribed($profile);
+            $twitter_user['following'] = $this->auth_user->isSubscribed($profile);
 
             // Notifications on?
             $sub = Subscription::pkeyGet(array('subscriber' =>
-                $apidata['user']->id, 'subscribed' => $profile->id));
+                                               $this->auth_user->id,
+                                               'subscribed' => $profile->id));
 
             if ($sub) {
                 $twitter_user['notifications'] = ($sub->jabber || $sub->sms);
index 0d1613d381ed17de89be5410b47e1b7df2f04637..7102764cbaa753489430f072522db5cd37c3ccb1 100644 (file)
@@ -53,8 +53,6 @@ require_once INSTALLDIR . '/lib/api.php';
 class ApiAuthAction extends ApiAction
 {
 
-    var $auth_user = null;
-
     /**
      * Take arguments for running, and output basic auth header if needed
      *