]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add source link attr to statusnet:notice_info element in Atom output for notices
authorZach Copley <zach@status.net>
Thu, 6 May 2010 07:44:56 +0000 (00:44 -0700)
committerZach Copley <zach@status.net>
Thu, 6 May 2010 21:48:11 +0000 (21:48 +0000)
classes/Notice.php

index cd27376a4ae8a9b21966661699063d5fe2b7b3b4..b3cfb281383568b200abe083810a560339781274 100644 (file)
@@ -1216,8 +1216,14 @@ class Notice extends Memcached_DataObject
             $noticeInfoAttr = array(
                 'local_id'   => $this->id,    // local notice ID (useful to clients for ordering)
                 'source'     => $this->source // the client name (source attribution)
-                // @todo source source_link
-                );
+            );
+
+            $ns = $this->getSource();
+            if ($ns) {
+                if (!empty($ns->url)) {
+                    $noticeInfoAttr['source_link'] = htmlentities($ns->url);
+                }
+            }
 
             if (!empty($cur)) {
                 $noticeInfoAttr['favorited'] = ($cur->hasFave($this)) ? 'true' : 'false';