]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
RSS 1.0 actions were reading the stream from the database twice. Inefficient, but...
authorCiaranG <ciaran@ciarang.com>
Sat, 21 Mar 2009 14:18:38 +0000 (14:18 +0000)
committerCiaranG <ciaran@ciarang.com>
Sat, 21 Mar 2009 14:18:38 +0000 (14:18 +0000)
lib/rssaction.php

index 66c2d9e8cd2399adf22a6311a044ae604fadf458..ddba862dcf9b22113d74787215f3a15f094e6b5a 100644 (file)
@@ -94,11 +94,11 @@ class Rss10Action extends Action
 
     function handle($args)
     {
-        // Get the list of notices
-        $this->notices = $this->getNotices();
         // Parent handling, including cache check
         parent::handle($args);
-        $this->showRss($this->limit);
+        // Get the list of notices
+        $this->notices = $this->getNotices($this->limit);
+        $this->showRss();
     }
 
     /**
@@ -132,15 +132,13 @@ class Rss10Action extends Action
         return null;
     }
 
-    function showRss($limit=0)
+    function showRss()
     {
-        $notices = $this->getNotices($limit);
-
         $this->initRss();
-        $this->showChannel($notices);
+        $this->showChannel();
         $this->showImage();
 
-        foreach ($notices as $n) {
+        foreach ($this->notices as $n) {
             $this->showItem($n);
         }
 
@@ -148,7 +146,7 @@ class Rss10Action extends Action
         $this->endRss();
     }
 
-    function showChannel($notices)
+    function showChannel()
     {
 
         $channel = $this->getChannel();
@@ -167,7 +165,7 @@ class Rss10Action extends Action
         $this->elementStart('items');
         $this->elementStart('rdf:Seq');
 
-        foreach ($notices as $notice) {
+        foreach ($this->notices as $notice) {
             $this->element('sioct:MicroblogPost', array('rdf:resource' => $notice->uri));
         }