forked from GNUsocial/gnu-social
Fix issue with favorited/following always being set to false
This commit is contained in:
parent
364038ce2a
commit
918b662568
@ -55,6 +55,7 @@ class ApiAction extends Action
|
|||||||
{
|
{
|
||||||
var $format = null;
|
var $format = null;
|
||||||
var $user = null;
|
var $user = null;
|
||||||
|
var $auth_user = null;
|
||||||
var $page = null;
|
var $page = null;
|
||||||
var $count = null;
|
var $count = null;
|
||||||
var $max_id = null;
|
var $max_id = null;
|
||||||
@ -188,13 +189,14 @@ class ApiAction extends Action
|
|||||||
$twitter_user['following'] = false;
|
$twitter_user['following'] = false;
|
||||||
$twitter_user['notifications'] = 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?
|
// Notifications on?
|
||||||
$sub = Subscription::pkeyGet(array('subscriber' =>
|
$sub = Subscription::pkeyGet(array('subscriber' =>
|
||||||
$apidata['user']->id, 'subscribed' => $profile->id));
|
$this->auth_user->id,
|
||||||
|
'subscribed' => $profile->id));
|
||||||
|
|
||||||
if ($sub) {
|
if ($sub) {
|
||||||
$twitter_user['notifications'] = ($sub->jabber || $sub->sms);
|
$twitter_user['notifications'] = ($sub->jabber || $sub->sms);
|
||||||
|
@ -53,8 +53,6 @@ require_once INSTALLDIR . '/lib/api.php';
|
|||||||
class ApiAuthAction extends ApiAction
|
class ApiAuthAction extends ApiAction
|
||||||
{
|
{
|
||||||
|
|
||||||
var $auth_user = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take arguments for running, and output basic auth header if needed
|
* Take arguments for running, and output basic auth header if needed
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user