summaryrefslogtreecommitdiff
path: root/lib/rssaction.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rssaction.php')
-rw-r--r--lib/rssaction.php38
1 files changed, 31 insertions, 7 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php
index f19c8e1c5..66c2d9e8c 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -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);
}
@@ -178,11 +182,11 @@ class Rss10Action extends Action
$image = $this->getImage();
if ($image) {
$channel = $this->getChannel();
- common_element_start('image', array('rdf:about' => $image));
- common_element('title', null, $channel['title']);
- common_element('link', null, $channel['link']);
- common_element('url', null, $image);
- common_element_end('image');
+ $this->elementStart('image', array('rdf:about' => $image));
+ $this->element('title', null, $channel['title']);
+ $this->element('link', null, $channel['link']);
+ $this->element('url', null, $image);
+ $this->elementEnd('image');
}
}
@@ -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);
+ }
}