summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-03 17:35:18 -0800
committerZach Copley <zach@status.net>2010-03-03 20:58:34 -0800
commitf210cadfecc4f87e1fb8e35cd784a7010c443c31 (patch)
tree8c900b41211719b4e2267126f670ad97a3230c27
parentb97ac60209fdec3f2d521f7c9d54acca6d00d274 (diff)
Revert "Revert "Show <activity:subject> and no activity actors for user feed""
This reverts commit e2578cfad68c45ca177c51997c4cc7c0abafbd9a.
-rw-r--r--classes/Notice.php8
-rw-r--r--lib/atomnoticefeed.php16
-rw-r--r--lib/atomusernoticefeed.php11
3 files changed, 29 insertions, 6 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 97cb3b8fb..4c7e6ab4b 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -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',
diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php
index 3c3556cb9..e4df731fe 100644
--- a/lib/atomnoticefeed.php
+++ b/lib/atomnoticefeed.php
@@ -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;
+ }
+}
diff --git a/lib/atomusernoticefeed.php b/lib/atomusernoticefeed.php
index 55cebef6d..428cc2de2 100644
--- a/lib/atomusernoticefeed.php
+++ b/lib/atomusernoticefeed.php
@@ -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;
+ }
}