From f9481467f84fe92bde0d0e820a7ffa1a37e62e4b Mon Sep 17 00:00:00 2001
From: Mikael Nordfeldth <mmn@hethane.se>
Date: Sun, 11 May 2014 21:11:09 +0200
Subject: [PATCH] ConversationAction extends from ManagedAction

Also added some of the nifty autoconfiguration, such as $this->scoped,
to ConversationAction for increased code consistency.
---
 actions/conversation.php | 30 ++++--------------------------
 1 file changed, 4 insertions(+), 26 deletions(-)

diff --git a/actions/conversation.php b/actions/conversation.php
index aa2539d213..3eb588c651 100644
--- a/actions/conversation.php
+++ b/actions/conversation.php
@@ -45,12 +45,11 @@ require_once INSTALLDIR.'/lib/noticelist.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class ConversationAction extends Action
+class ConversationAction extends ManagedAction
 {
     var $id          = null;
     var $page        = null;
     var $notices     = null;
-    var $userProfile = null;
 
     const MAX_NOTICES = 500;
 
@@ -61,7 +60,7 @@ class ConversationAction extends Action
      *
      * @return boolean false if id not passed in
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
         $this->id = $this->trimmed('id');
@@ -74,34 +73,13 @@ class ConversationAction extends Action
             $this->page = 1;
         }
 
-        $cur = common_current_user();
-
-        if (empty($cur)) {
-            $this->userProfile = null;
-        } else {
-            $this->userProfile = $cur->getProfile();
-        }
-
-        $stream = new ConversationNoticeStream($this->id, $this->userProfile);
+        $stream = new ConversationNoticeStream($this->id, $this->scoped);
 
         $this->notices = $stream->getNotices(0, self::MAX_NOTICES);
 
         return true;
     }
 
-    /**
-     * Handle the action
-     *
-     * @param array $args Web and URL arguments
-     *
-     * @return void
-     */
-    function handle($args)
-    {
-        parent::handle($args);
-        $this->showPage();
-    }
-
     /**
      * Returns the page title
      *
@@ -128,7 +106,7 @@ class ConversationAction extends Action
         if (!empty($user) && $user->conversationTree()) {
             $nl = new ConversationTree($this->notices, $this);
         } else {
-            $nl = new FullThreadedNoticeList($this->notices, $this, $this->userProfile);
+            $nl = new FullThreadedNoticeList($this->notices, $this, $this->scoped);
         }
 
         $cnt = $nl->show();
-- 
2.39.5