]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
pass user profile to ThreadedNoticeList in PublicAction
authorEvan Prodromou <evan@status.net>
Mon, 11 Apr 2011 15:18:12 +0000 (11:18 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 11 Apr 2011 15:18:12 +0000 (11:18 -0400)
actions/public.php

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