]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/rssaction.php
Fixes #1241: in-reply-to links were broken due to copy and paste error (Variable...
[quix0rs-gnu-social.git] / lib / rssaction.php
index 2bd7f1f19dcb18b338a43f01c0eb387eeb687506..66c2d9e8cd2399adf22a6311a044ae604fadf458 100644 (file)
@@ -38,6 +38,7 @@ class Rss10Action extends Action
 
     var $creators = array();
     var $limit = DEFAULT_RSS_LIMIT;
+    var $notices = null;
 
     /**
      * Constructor
@@ -93,6 +94,9 @@ 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);
     }
@@ -199,7 +203,7 @@ class Rss10Action extends Action
         $this->element('dc:date', null, common_date_w3dtf($notice->created));
         $this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname);
         $this->element('sioc:has_creator', array('rdf:resource' => $creator_uri));
-        $this->element('laconica:postIcon', array('rdf:resource' => common_profile_avatar_url($profile)));
+        $this->element('laconica:postIcon', array('rdf:resource' => $profile->avatarUrl()));
         $this->element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
         $this->elementEnd('item');
         $this->creators[$creator_uri] = $profile;
@@ -216,7 +220,7 @@ class Rss10Action extends Action
                 $this->element('foaf:name', null, $profile->fullname);
             }
             $this->element('sioc:id', null, $id);
-            $avatar = common_profile_avatar_url($profile);
+            $avatar = $profile->avatarUrl();
             $this->element('sioc:avatar', array('rdf:resource' => $avatar));
             $this->elementEnd('sioc:User');
         }
@@ -258,5 +262,25 @@ class Rss10Action extends Action
     {
         $this->elementEnd('rdf:RDF');
     }
+
+    /**
+     * When was this page last modified?
+     *
+     */
+
+    function lastModified()
+    {
+        if (empty($this->notices)) {
+            return null;
+        }
+
+        if (count($this->notices) == 0) {
+            return null;
+        }
+
+        // FIXME: doesn't handle modified profiles, avatars, deleted notices
+
+        return strtotime($this->notices[0]->created);
+    }
 }