]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/allrss.php
make it possible to erase fields in the profile via the api
[quix0rs-gnu-social.git] / actions / allrss.php
index 573bb4eb2fac27c83a200df9d8b40bfa6347ed2a..fee52c79ab3c7301f307865c6504b12ec39d6d5e 100644 (file)
@@ -62,12 +62,11 @@ class AllrssAction extends Rss10Action
     {
         parent::prepare($args);
         $nickname   = $this->trimmed('nickname');
-        $this->user = User::staticGet('nickname', $nickname);
+        $this->user = User::getKV('nickname', $nickname);
 
         if (!$this->user) {
             // TRANS: Client error when user not found for an rss related action.
             $this->clientError(_('No such user.'));
-            return false;
         } else {
             $this->notices = $this->getNotices($this->limit);
             return true;
@@ -83,16 +82,9 @@ class AllrssAction extends Rss10Action
      */
     function getNotices($limit=0)
     {
-        $cur = common_current_user();
-        $user = $this->user;
-
-        if (!empty($cur) && $cur->id == $user->id) {
-            $notice = $this->user->noticeInbox(0, $limit);
-        } else {
-            $notice = $this->user->noticesWithFriends(0, $limit);
-        }
+        $stream = new InboxNoticeStream($this->user->getProfile());
+        $notice = $stream->getNotices(0, $limit, null, null);
 
-        $notice  = $user->noticesWithFriends(0, $limit);
         $notices = array();
 
         while ($notice->fetch()) {
@@ -136,7 +128,6 @@ class AllrssAction extends Rss10Action
         if (!$profile) {
             return null;
         }
-        $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
-        return $avatar ? $avatar->url : null;
+        return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
     }
 }