]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ostatus:attention links in Notice Atom output
authorZach Copley <zach@status.net>
Thu, 11 Feb 2010 23:24:18 +0000 (15:24 -0800)
committerZach Copley <zach@status.net>
Fri, 12 Feb 2010 00:29:27 +0000 (16:29 -0800)
classes/Notice.php
classes/Profile.php

index 091f2dc7b406279a5714a3c060fb7daca88f06a0..a39388cdb3a648b47885a4609e5e900bf7ebe39b 100644 (file)
@@ -994,7 +994,7 @@ class Notice extends Memcached_DataObject
         $xs->element('summary', null, $this->content);
 
         $xs->raw($profile->asAtomAuthor());
-        $xs->raw($profile->asActivityActor($namespace));
+        $xs->raw($profile->asActivityActor());
 
         $xs->element('link', array('rel' => 'alternate',
                                    'href' => $this->bestUrl()));
@@ -1028,6 +1028,20 @@ class Notice extends Memcached_DataObject
                 );
         }
 
+        $reply_ids = $this->getReplies();
+
+        foreach ($reply_ids as $id) {
+            $profile = Profile::staticGet('id', $id);
+            if (!empty($profile)) {
+                $xs->element(
+                    'link', array(
+                        'rel' => 'osatus:attention',
+                        'href' => $profile->getAcctUri()
+                    )
+                );
+            }
+        }
+
         if (!empty($this->repeat_of)) {
             $repeat = Notice::staticGet('id', $this->repeat_of);
             if (!empty($repeat)) {
index 664c45f6403d16e3dd18babd96c663ac47eb0b02..3e5150c182b56030288cabe7619b46c9f3f0626d 100644 (file)
@@ -803,4 +803,10 @@ class Profile extends Memcached_DataObject
 
         return $xs->getString();
     }
+
+    function getAcctUri()
+    {
+        return $this->nickname . '@' . common_config('site', 'server');
+    }
+
 }