- $notices = Notice::conversationStream($this->id, null, null);
-
- $ct = new ConversationTree($notices, $this);
-
- $cnt = $ct->show();
- }
-
- function isReadOnly()
- {
- return true;
- }
-}
-
-/**
- * Conversation tree
- *
- * The widget class for displaying a hierarchical list of notices.
- *
- * @category Widget
- * @package StatusNet
- * @author Evan Prodromou <evan@status.net>
- * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
- * @link http://status.net/
- */
-class ConversationTree extends NoticeList
-{
- var $tree = null;
- var $table = null;
-
- /**
- * Show the tree of notices
- *
- * @return void
- */
- function show()
- {
- $cnt = $this->_buildTree();
-
- $this->out->elementStart('div', array('id' =>'notices_primary'));
- // TRANS: Header on conversation page. Hidden by default (h2).
- $this->out->element('h2', null, _('Notices'));
- $this->out->elementStart('ol', array('class' => 'notices xoxo'));
-
- if (array_key_exists('root', $this->tree)) {
- $rootid = $this->tree['root'][0];
- $this->showNoticePlus($rootid);
- }
-
- $this->out->elementEnd('ol');
- $this->out->elementEnd('div');
-
- return $cnt;
- }
-
- function _buildTree()
- {
- $cnt = 0;
-
- $this->tree = array();
- $this->table = array();
-
- while ($this->notice->fetch()) {
-
- $cnt++;
-
- $id = $this->notice->id;
- $notice = clone($this->notice);
-
- $this->table[$id] = $notice;
-
- if (is_null($notice->reply_to)) {
- $this->tree['root'] = array($notice->id);
- } else if (array_key_exists($notice->reply_to, $this->tree)) {
- $this->tree[$notice->reply_to][] = $notice->id;
- } else {
- $this->tree[$notice->reply_to] = array($notice->id);
- }
+ if (Event::handle('StartShowConversation', array($this, $this->conv, $this->scoped))) {
+ $notices = $this->conv->getNotices($this->scoped);
+ $nl = new FullThreadedNoticeList($notices, $this, $this->scoped);
+ $cnt = $nl->show();