]> 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>
Tue, 18 May 2010 22:15:41 +0000 (15:15 -0700)
classes/Notice.php

index 2c2c87d560ac06ce2424a5e536cc3ee1411a7e0c..1965012797f6f8c6917490b83d999b571d57edbe 100644 (file)
@@ -1215,8 +1215,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';