pass user profile to ThreadedNoticeList in PublicAction

This commit is contained in:
Evan Prodromou 2011-04-11 11:18:12 -04:00
parent cc9f65ac81
commit 19bd6fded4

View File

@ -59,6 +59,7 @@ class PublicAction extends Action
var $page = null; var $page = null;
var $notice; var $notice;
var $userProfile = null;
function isReadOnly($args) function isReadOnly($args)
{ {
@ -85,15 +86,9 @@ class PublicAction extends Action
common_set_returnto($this->selfUrl()); common_set_returnto($this->selfUrl());
$profile = null; $this->userProfile = Profile::current();
$user = common_current_user();
if (!empty($user)) { $stream = new PublicNoticeStream($this->userProfile);
$profile = $user->getProfile();
}
$stream = new PublicNoticeStream($profile);
$this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE, $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
NOTICES_PER_PAGE + 1); NOTICES_PER_PAGE + 1);
@ -213,7 +208,7 @@ class PublicAction extends Action
*/ */
function showContent() function showContent()
{ {
$nl = new ThreadedNoticeList($this->notice, $this); $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
$cnt = $nl->show(); $cnt = $nl->show();