summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-03-04 00:29:56 -0500
committerSarven Capadisli <csarven@status.net>2010-03-04 00:29:56 -0500
commit9501882e80a5f07574506bcae027e7a93e20b1af (patch)
treeff4390493257353611cf9b0ef3fed9c680353d0a /lib
parentce9d1618851156cc225a56980c4268a5fe102806 (diff)
parent8ffb34a90c78502843aabaac71963d2f40c505d8 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline 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;
+ }
}