]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/api.php
Delete design when user chooses to restore default design, instead
[quix0rs-gnu-social.git] / lib / api.php
index 5e66639c4f64075dfd78d632dae6614e413762e6..5a3bb5ee451011aaec324399da0e6755929e70fc 100644 (file)
@@ -134,7 +134,6 @@ class ApiAction extends Action
         $twitter_user['protected'] = false; # not supported by StatusNet yet
         $twitter_user['followers_count'] = $profile->subscriberCount();
 
-        $defaultDesign = Design::siteDesign();
         $design        = null;
         $user          = $profile->getUser();
 
@@ -145,7 +144,7 @@ class ApiAction extends Action
         }
 
         if (empty($design)) {
-            $design = $defaultDesign;
+            $design = Design::siteDesign();
         }
 
         $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
@@ -176,9 +175,14 @@ class ApiAction extends Action
         $twitter_user['utc_offset'] = $t->format('Z');
         $twitter_user['time_zone'] = $timezone;
 
-        // To be supported some day, perhaps
-        $twitter_user['profile_background_image_url'] = '';
-        $twitter_user['profile_background_tile'] = false;
+        $twitter_user['profile_background_image_url']
+            = empty($design->backgroundimage)
+            ? '' : ($design->disposition & BACKGROUND_ON)
+            ? Design::url($design->backgroundimage) : '';
+
+        $twitter_user['profile_background_tile']
+            = empty($design->disposition)
+            ? '' : ($design->disposition & BACKGROUND_TILE) ? 'true' : 'false';
 
         $twitter_user['statuses_count'] = $profile->noticeCount();