]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
include protected flag for users in JSON or XML
authorEvan Prodromou <evan@status.net>
Mon, 4 Apr 2011 21:44:23 +0000 (17:44 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 4 Apr 2011 21:44:23 +0000 (17:44 -0400)
lib/apiaction.php

index 3b3ece17cdbb00b54d960cbbf1cb17a1d5bfe959..1dfeea998af12b6a90ab62b6db6f70545935e488 100644 (file)
@@ -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