summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-03-04 01:31:19 -0500
committerJames Walker <walkah@walkah.net>2010-03-04 01:31:19 -0500
commit9cbeac5695454af0c2fa1a8068b45698da962064 (patch)
treebbc385497859fbf956205309836f5264762288d5 /lib
parent849f5783c445934da370769310b3b0382bc5d303 (diff)
parent4b99bfce455fbbfda34f46367eb3313c0bf8c9ea (diff)
Merge remote branch 'statusnet/testing' into testing
Diffstat (limited to 'lib')
-rw-r--r--lib/activity.php12
-rw-r--r--lib/atomnoticefeed.php16
-rw-r--r--lib/atomusernoticefeed.php11
3 files changed, 36 insertions, 3 deletions
diff --git a/lib/activity.php b/lib/activity.php
index ce14fa254..e1bce6f19 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -1060,6 +1060,18 @@ class Activity
}
$this->entry = $entry;
+
+ // @fixme Don't send in a DOMDocument
+ if ($feed instanceof DOMDocument) {
+ common_log(
+ LOG_WARNING,
+ 'Activity::__construct() - '
+ . 'DOMDocument passed in for feed by mistake. '
+ . "Expecting a 'feed' DOMElement."
+ );
+ $feed = $feed->getElementsByTagName('feed')->item(0);
+ }
+
$this->feed = $feed;
$pubEl = $this->_child($entry, self::PUBLISHED, self::ATOM);
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;
+ }
}