From ddbd4801e067a4ec023f93a89bf28139b3c43f78 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 4 Apr 2011 17:44:23 -0400 Subject: [PATCH] include protected flag for users in JSON or XML --- lib/apiaction.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index 3b3ece17cd..1dfeea998a 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -202,6 +202,8 @@ class ApiAction extends Action { $twitter_user = array(); + $user = $profile->getUser(); + $twitter_user['id'] = intval($profile->id); $twitter_user['name'] = $profile->getBestName(); $twitter_user['screen_name'] = $profile->nickname; @@ -213,11 +215,10 @@ class ApiAction extends Action Avatar::defaultImage(AVATAR_STREAM_SIZE); $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; - $twitter_user['protected'] = false; # not supported by StatusNet yet + $twitter_user['protected'] = ($user->private_stream) ? true : false; $twitter_user['followers_count'] = $profile->subscriberCount(); - $design = null; - $user = $profile->getUser(); + $design = null; // Note: some profiles don't have an associated user -- 2.39.5