From: Evan Prodromou Date: Sun, 2 Jan 2011 23:22:12 +0000 (-0800) Subject: preserve activities in object X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aa9137ca71a2e7e4c9e00ba60be637530dc94c2b;p=quix0rs-gnu-social.git preserve activities in object --- 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)); } }