]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/apiaction.php
Rip out user, group and site design customization code
[quix0rs-gnu-social.git] / lib / apiaction.php
index a77d5da13fe6779376274991d367cbd5a22b7e13..64b4284f6aa1e2eb4e57ddc00efa3e0e88ea7d2b 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,34 +215,11 @@ 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();
-
         // Note: some profiles don't have an associated user
 
-        $defaultDesign = Design::siteDesign();
-
-        if (!empty($user)) {
-            $design = $user->getDesign();
-        }
-
-        if (empty($design)) {
-            $design = $defaultDesign;
-        }
-
-        $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
-        $twitter_user['profile_background_color'] = ($color == null) ? '' : '#'.$color->hexValue();
-        $color = Design::toWebColor(empty($design->textcolor) ? $defaultDesign->textcolor : $design->textcolor);
-        $twitter_user['profile_text_color'] = ($color == null) ? '' : '#'.$color->hexValue();
-        $color = Design::toWebColor(empty($design->linkcolor) ? $defaultDesign->linkcolor : $design->linkcolor);
-        $twitter_user['profile_link_color'] = ($color == null) ? '' : '#'.$color->hexValue();
-        $color = Design::toWebColor(empty($design->sidebarcolor) ? $defaultDesign->sidebarcolor : $design->sidebarcolor);
-        $twitter_user['profile_sidebar_fill_color'] = ($color == null) ? '' : '#'.$color->hexValue();
-        $twitter_user['profile_sidebar_border_color'] = '';
-
         $twitter_user['friends_count'] = $profile->subscriptionCount();
 
         $twitter_user['created_at'] = $this->dateTwitter($profile->created);
@@ -258,15 +237,6 @@ class ApiAction extends Action
 
         $twitter_user['utc_offset'] = $t->format('Z');
         $twitter_user['time_zone'] = $timezone;
-
-        $twitter_user['profile_background_image_url']
-            = empty($design->backgroundimage)
-            ? '' : ($design->disposition & BACKGROUND_ON)
-            ? Design::url($design->backgroundimage) : '';
-
-        $twitter_user['profile_background_tile']
-            = (bool)($design->disposition & BACKGROUND_TILE);
-
         $twitter_user['statuses_count'] = $profile->noticeCount();
 
         // Is the requesting user following this user?
@@ -292,7 +262,7 @@ class ApiAction extends Action
         if ($get_notice) {
             $notice = $profile->getCurrentNotice();
             if ($notice) {
-                # don't get user!
+                // don't get user!
                 $twitter_user['status'] = $this->twitterStatusArray($notice, false);
             }
         }
@@ -397,7 +367,7 @@ class ApiAction extends Action
         }
 
         if ($include_user && $profile) {
-            # Don't get notice (recursive!)
+            // Don't get notice (recursive!)
             $twitter_user = $this->twitterUserArray($profile, false);
             $twitter_status['user'] = $twitter_user;
         }
@@ -738,7 +708,7 @@ class ApiAction extends Action
         $this->element('guid', null, $entry['guid']);
         $this->element('link', null, $entry['link']);
 
-        # RSS only supports 1 enclosure per item
+        // RSS only supports 1 enclosure per item
         if(array_key_exists('enclosures', $entry) and !empty($entry['enclosures'])){
             $enclosure = $entry['enclosures'][0];
             $this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
@@ -873,7 +843,7 @@ class ApiAction extends Action
         }
 
         if (!is_null($suplink)) {
-            # For FriendFeed's SUP protocol
+            // For FriendFeed's SUP protocol
             $this->element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup',
                                          'href' => $suplink,
                                          'type' => 'application/json'));