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')) { exit(1); }
34 * Conversation tree in the browser
36 * Will always try to show the entire conversation, since that's how our
37 * ConversationNoticeStream works.
41 * @author Evan Prodromou <evan@status.net>
42 * @author Mikael Nordfeldth <mmn@hethane.se>
43 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
44 * @link http://status.net/
46 class ConversationAction extends ManagedAction
52 protected function doPreparation()
54 $this->conv = Conversation::getByID($this->int('id'));
58 * Returns the page title
60 * @return string page title
64 // TRANS: Title for page with a conversion (multiple notices in context).
65 return _('Conversation');
71 * NoticeList extended classes do most heavy lifting. Plugins can override.
75 function showContent()
77 if (Event::handle('StartShowConversation', array($this, $this->conv, $this->scoped))) {
78 $notices = $this->conv->getNotices($this->scoped);
79 $nl = new FullThreadedNoticeList($notices, $this, $this->scoped);
82 Event::handle('EndShowConversation', array($this, $this->conv, $this->scoped));
85 function isReadOnly($args)
93 return array(new Feed(Feed::JSON,
94 common_local_url('apiconversation',
96 'id' => $this->conv->getID(),
98 // TRANS: Title for link to notice feed.
99 // TRANS: %s is a user nickname.
100 _('Conversation feed (Activity Streams JSON)')),
102 common_local_url('apiconversation',
104 'id' => $this->conv->getID(),
106 // TRANS: Title for link to notice feed.
107 // TRANS: %s is a user nickname.
108 _('Conversation feed (RSS 2.0)')),
110 common_local_url('apiconversation',
112 'id' => $this->conv->getID(),
113 'format' => 'atom')),
114 // TRANS: Title for link to notice feed.
115 // TRANS: %s is a user nickname.
116 _('Conversation feed (Atom)')));