3 * Display a conversation in the browser
9 * @author Evan Prodromou <evan@status.net>
10 * @author Mikael Nordfeldth <mmn@hethane.se>
11 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
12 * @link http://status.net/
14 * StatusNet - the distributed open-source microblogging tool
15 * Copyright (C) 2009, StatusNet, Inc.
17 * This program is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Affero General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Affero General Public License for more details.
27 * You should have received a copy of the GNU Affero General Public License
28 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31 if (!defined('GNUSOCIAL')) {
36 * Conversation tree in the browser
38 * Will always try to show the entire conversation, since that's how our
39 * ConversationNoticeStream works.
43 * @author Evan Prodromou <evan@status.net>
44 * @author Mikael Nordfeldth <mmn@hethane.se>
45 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
46 * @link http://status.net/
48 class ConversationAction extends ManagedAction
50 protected $redirectAfterLogin = true;
54 public $notices = null;
56 protected function doPreparation()
58 $this->conv = Conversation::getByID($this->int('id'));
62 * Returns the page title
64 * @return string page title
66 public function title()
68 // TRANS: Title for page with a conversion (multiple notices in context).
69 return _('Conversation');
75 * NoticeList extended classes do most heavy lifting. Plugins can override.
79 public function showContent()
81 if (Event::handle('StartShowConversation', [$this, $this->conv, $this->scoped])) {
82 $notices = $this->conv->getNotices($this->scoped);
83 $nl = new FullThreadedNoticeList($notices, $this, $this->scoped);
86 Event::handle('EndShowConversation', [$this, $this->conv, $this->scoped]);
89 public function isReadOnly($args)
94 public function getFeeds()
98 common_local_url('apiconversation',
99 ['id' => $this->conv->getID(),
101 // TRANS: Title for link to notice feed.
102 // TRANS: %s is a user nickname.
103 _('Conversation feed (Activity Streams JSON)')
106 common_local_url('apiconversation',
107 ['id' => $this->conv->getID(),
109 // TRANS: Title for link to notice feed.
110 // TRANS: %s is a user nickname.
111 _('Conversation feed (RSS 2.0)')
114 common_local_url('apiconversation',
115 ['id' => $this->conv->getID(),
116 'format' => 'atom']),
117 // TRANS: Title for link to notice feed.
118 // TRANS: %s is a user nickname.
119 _('Conversation feed (Atom)')