]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Revert "Revert "Show <activity:subject> and no activity actors for user feed""
authorZach Copley <zach@status.net>
Thu, 4 Mar 2010 01:35:18 +0000 (17:35 -0800)
committerZach Copley <zach@status.net>
Thu, 4 Mar 2010 04:58:34 +0000 (20:58 -0800)
This reverts commit e2578cfad68c45ca177c51997c4cc7c0abafbd9a.

classes/Notice.php
lib/atomnoticefeed.php
lib/atomusernoticefeed.php

index 97cb3b8fbe0e6dae58f6ee512fedbee70e47b5fd..4c7e6ab4b708e7452e34dbc338fa0161cd919a83 100644 (file)
@@ -1106,7 +1106,7 @@ class Notice extends Memcached_DataObject
         return $groups;
     }
 
-    function asAtomEntry($namespace=false, $source=false)
+    function asAtomEntry($namespace=false, $source=false, $author=true)
     {
         $profile = $this->getProfile();
 
@@ -1151,8 +1151,10 @@ class Notice extends Memcached_DataObject
 
         $xs->element('title', null, $this->content);
 
-        $xs->raw($profile->asAtomAuthor());
-        $xs->raw($profile->asActivityActor());
+        if ($author) {
+            $xs->raw($profile->asAtomAuthor());
+            $xs->raw($profile->asActivityActor());
+        }
 
         $xs->element('link', array('rel' => 'alternate',
                                    'type' => 'text/html',
index 3c3556cb95c789c59c951440cf73c6b12ad64801..e4df731fe02a5c3bdb7657f6d504177395345ae1 100644 (file)
@@ -107,9 +107,19 @@ class AtomNoticeFeed extends Atom10Feed
      */
     function addEntryFromNotice($notice)
     {
-        $this->addEntryRaw($notice->asAtomEntry());
-    }
+        $source = $this->showSource();
+        $author = $this->showAuthor();
 
-}
+        $this->addEntryRaw($notice->asAtomEntry(false, $source, $author));
+    }
 
+    function showSource()
+    {
+        return true;
+    }
 
+    function showAuthor()
+    {
+        return true;
+    }
+}
index 55cebef6df9551a482edf0ca2522b7cf6f02cd52..428cc2de2f01192f46a212e97e398f97ba7afd5b 100644 (file)
@@ -61,6 +61,7 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
         if (!empty($user)) {
             $profile = $user->getProfile();
             $this->addAuthor($profile->nickname, $user->uri);
+            $this->setActivitySubject($profile->asActivityNoun('subject'));
         }
 
         $title      = sprintf(_("%s timeline"), $user->nickname);
@@ -105,4 +106,14 @@ class AtomUserNoticeFeed extends AtomNoticeFeed
     {
         return $this->user;
     }
+
+    function showSource()
+    {
+        return false;
+    }
+
+    function showAuthor()
+    {
+        return false;
+    }
 }