From 1166f9d7c1fa04a4006407a8ad8fa20abf2263b1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 2 Jan 2011 15:22:12 -0800 Subject: [PATCH] preserve activities in object --- lib/useractivitystream.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/useractivitystream.php b/lib/useractivitystream.php index 0fc315e26e..7d9b02ded8 100644 --- a/lib/useractivitystream.php +++ b/lib/useractivitystream.php @@ -28,6 +28,8 @@ class UserActivityStream extends AtomUserNoticeFeed { + public $activities = array(); + function __construct($user, $indent = true) { parent::__construct($user, null, $indent); @@ -45,10 +47,15 @@ class UserActivityStream extends AtomUserNoticeFeed usort($objs, 'UserActivityStream::compareObject'); foreach ($objs as $obj) { - $act = $obj->asActivity(); + $this->activities[] = $obj->asActivity(); + } + } + + function renderEntries() + { + foreach ($this->activities as $act) { // Only show the author sub-element if it's different from default user - $str = $act->asString(false, ($act->actor->id != $this->user->uri)); - $this->addEntryRaw($str); + $act->outputTo($this, false, ($act->actor->id != $this->user->uri)); } }