]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apitimelinefavorites.php
Properly unlink all old avatars when deleting/uploading a new
[quix0rs-gnu-social.git] / actions / apitimelinefavorites.php
index 7e8dd7aad6e6bb0fefb058acb9dc111961072bdc..85f22d910bf514102183683d72ae1b5d7c4b6c35 100644 (file)
@@ -97,7 +97,6 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
     function showTimeline()
     {
         $profile  = $this->user->getProfile();
-        $avatar   = $profile->getAvatar(AVATAR_PROFILE_SIZE);
 
         $sitename = common_config('site', 'name');
         $title    = sprintf(
@@ -120,15 +119,10 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
             $profile->getBestName(),
             $this->user->nickname
         );
-        $logo = !empty($avatar)
-            ? $avatar->displayUrl()
-            : Avatar::defaultImage(AVATAR_PROFILE_SIZE);
-
-        $link = common_local_url(
-            'showfavorites',
-            array('nickname' => $this->user->nickname)
-        );
 
+        $logo = $profile->avatarUrl(AVATAR_PROFILE_SIZE);
+        $link = common_local_url('showfavorites',
+                    array('nickname' => $this->user->nickname));
         $self = $this->getSelfUri();
 
         switch($this->format) {