3 * Display a conversation in the browser
9 * @author Evan Prodromou <evan@status.net>
10 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
11 * @link http://status.net/
13 * StatusNet - the distributed open-source microblogging tool
14 * Copyright (C) 2009, StatusNet, Inc.
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU Affero General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU Affero General Public License for more details.
26 * You should have received a copy of the GNU Affero General Public License
27 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 if (!defined('STATUSNET') && !defined('LACONICA')) {
34 // XXX: not sure how to do paging yet,
35 // so set a 60-notice limit
37 require_once INSTALLDIR.'/lib/noticelist.php';
40 * Conversation tree in the browser
44 * @author Evan Prodromou <evan@status.net>
45 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
46 * @link http://status.net/
48 class ConversationAction extends Action
53 var $userProfile = null;
55 const MAX_NOTICES = 500;
60 * @param array $args Web and URL arguments
62 * @return boolean false if id not passed in
64 function prepare($args)
66 parent::prepare($args);
67 $this->id = $this->trimmed('id');
68 if (empty($this->id)) {
71 $this->id = $this->id+0;
72 $this->page = $this->trimmed('page');
73 if (empty($this->page)) {
77 $cur = common_current_user();
80 $this->userProfile = null;
82 $this->userProfile = $cur->getProfile();
85 $stream = new ConversationNoticeStream($this->id, $this->userProfile);
87 $this->notices = $stream->getNotices(0, self::MAX_NOTICES);
95 * @param array $args Web and URL arguments
99 function handle($args)
101 parent::handle($args);
106 * Returns the page title
108 * @return string page title
112 // TRANS: Title for page with a conversion (multiple notices in context).
113 return _('Conversation');
119 * Display a hierarchical unordered list in the content area.
120 * Uses ConversationTree to do most of the heavy lifting.
124 function showContent()
126 $tnl = new FullThreadedNoticeList($this->notices, $this, $this->userProfile);
131 function isReadOnly()
139 return array(new Feed(Feed::JSON,
140 common_local_url('apiconversation',
144 // TRANS: Title for link to notice feed.
145 // TRANS: %s is a user nickname.
146 _('Conversation feed (Activity Streams JSON)')),
148 common_local_url('apiconversation',
152 // TRANS: Title for link to notice feed.
153 // TRANS: %s is a user nickname.
154 _('Conversation feed (RSS 2.0)')),
156 common_local_url('apiconversation',
159 'format' => 'atom')),
160 // TRANS: Title for link to notice feed.
161 // TRANS: %s is a user nickname.
162 _('Conversation feed (Activity Streams JSON)')));