X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fapiaction.php;h=14e21ae4fdc15f8ad8980862bc473a57d8e16fd8;hb=0b53b6768e03932f4beec6b6655763e6ecedc36d;hp=64b4284f6aa1e2eb4e57ddc00efa3e0e88ea7d2b;hpb=513c54fa89085fde783a73c298d61576f834b131;p=quix0rs-gnu-social.git diff --git a/lib/apiaction.php b/lib/apiaction.php index 64b4284f6a..14e21ae4fd 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -215,7 +215,7 @@ class ApiAction extends Action Avatar::defaultImage(AVATAR_STREAM_SIZE); $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; - $twitter_user['protected'] = ($user->private_stream) ? true : false; + $twitter_user['protected'] = (!empty($user) && $user->private_stream) ? true : false; $twitter_user['followers_count'] = $profile->subscriberCount(); // Note: some profiles don't have an associated user @@ -241,13 +241,13 @@ class ApiAction extends Action // Is the requesting user following this user? $twitter_user['following'] = false; - $twitter_user['statusnet:blocking'] = false; + $twitter_user['statusnet_blocking'] = false; $twitter_user['notifications'] = false; if (isset($this->auth_user)) { $twitter_user['following'] = $this->auth_user->isSubscribed($profile); - $twitter_user['statusnet:blocking'] = $this->auth_user->hasBlocked($profile); + $twitter_user['statusnet_blocking'] = $this->auth_user->hasBlocked($profile); // Notifications on? $sub = Subscription::pkeyGet(array('subscriber' => @@ -375,6 +375,7 @@ class ApiAction extends Action // StatusNet-specific $twitter_status['statusnet_html'] = $notice->rendered; + $twitter_status['statusnet_conversation_id'] = intval($notice->conversation); return $twitter_status; } @@ -957,9 +958,9 @@ class ApiAction extends Action $to_profile = $message->getTo(); $dmsg['id'] = intval($message->id); - $dmsg['sender_id'] = intval($from_profile); + $dmsg['sender_id'] = intval($from_profile->id); $dmsg['text'] = trim($message->content); - $dmsg['recipient_id'] = intval($to_profile); + $dmsg['recipient_id'] = intval($to_profile->id); $dmsg['created_at'] = $this->dateTwitter($message->created); $dmsg['sender_screen_name'] = $from_profile->nickname; $dmsg['recipient_screen_name'] = $to_profile->nickname;