]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/allrss.php
use inboxnoticestream in RSS 1.0
[quix0rs-gnu-social.git] / actions / allrss.php
index 7df0b1ef7c67c0ee2dc7389f9bede96d7373cdda..6d82e551e7cd6fa73395dce2281d3933168ad260 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * RSS feed for user and friends timeline action class.
  *
@@ -57,6 +56,7 @@ class AllrssAction extends Rss10Action
      * @param array $args Web and URL arguments
      *
      * @return boolean false if user doesn't exist
+     *
      */
     function prepare($args)
     {
@@ -65,6 +65,7 @@ class AllrssAction extends Rss10Action
         $this->user = User::staticGet('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 {
@@ -82,16 +83,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);
+        $notice = $stream->getNotices(0, $limit, null, null);
 
-        $notice  = $user->noticesWithFriends(0, $limit);
         $notices = array();
 
         while ($notice->fetch()) {
@@ -127,7 +121,7 @@ class AllrssAction extends Rss10Action
      * Get image.
      *
      * @return string user avatar URL or null
-    */
+     */
     function getImage()
     {
         $user    = $this->user;
@@ -139,4 +133,3 @@ class AllrssAction extends Rss10Action
         return $avatar ? $avatar->url : null;
     }
 }
-