summaryrefslogtreecommitdiff
path: root/lib/rssaction.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-07-09 13:18:57 -0400
committerCraig Andrews <candrews@integralblue.com>2009-07-09 13:18:57 -0400
commit69574591d0ac429475b1099e8d9f3e46f7a004ea (patch)
tree02ff2ef5709bfbf77cad3e04d75e81cb771d2c27 /lib/rssaction.php
parentd2e83b6a67fec311f9bc36a7d886f40169d9de15 (diff)
Notice attachments are enclosures in feeds (Atom, RSS 1.0/RDF, and RSS 2.0).
http://laconi.ca/trac/ticket/1690
Diffstat (limited to 'lib/rssaction.php')
-rw-r--r--lib/rssaction.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php
index 0c8188e88..fe3fd6f4a 100644
--- a/lib/rssaction.php
+++ b/lib/rssaction.php
@@ -216,6 +216,13 @@ class Rss10Action extends Action
$replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to));
$this->element('sioc:reply_of', array('rdf:resource' => $replyurl));
}
+ $attachments = $notice->attachments();
+ if($attachments){
+ foreach($attachments as $attachment){
+ $this->element('enc:enclosure', array('rdf:resource'=>$attachment->url,'enc:type'=>$attachment->mimetype,'enc:length'=>$attachment->size), null);
+ }
+ }
+
$this->elementEnd('item');
$this->creators[$creator_uri] = $profile;
}
@@ -251,6 +258,8 @@ class Rss10Action extends Action
'http://creativecommons.org/ns#',
'xmlns:content' =>
'http://purl.org/rss/1.0/modules/content/',
+ 'xmlns:enc' =>
+ 'http://purl.oclc.org/net/rss_2.0/enc#',
'xmlns:foaf' =>
'http://xmlns.com/foaf/0.1/',
'xmlns:sioc' =>