123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class ConversationAction extends ManagedAction
- {
- var $conv = null;
- var $page = null;
- var $notices = null;
-
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- $convId = $this->int('id');
- $this->conv = Conversation::getKV('id', $convId);
- if (!$this->conv instanceof Conversation) {
- throw new ClientException('Could not find specified conversation');
- }
- return true;
- }
-
- function title()
- {
-
- return _('Conversation');
- }
-
- function showContent()
- {
- if (Event::handle('StartShowConversation', array($this, $this->conv, $this->scoped))) {
- $notices = $this->conv->getNotices();
- $nl = new FullThreadedNoticeList($notices, $this, $this->scoped);
- $cnt = $nl->show();
- }
- Event::handle('EndShowConversation', array($this, $this->conv, $this->scoped));
- }
- function isReadOnly()
- {
- return true;
- }
-
- function getFeeds()
- {
-
- return array(new Feed(Feed::JSON,
- common_local_url('apiconversation',
- array(
- 'id' => $this->conv->id,
- 'format' => 'as')),
-
-
- _('Conversation feed (Activity Streams JSON)')),
- new Feed(Feed::RSS2,
- common_local_url('apiconversation',
- array(
- 'id' => $this->conv->id,
- 'format' => 'rss')),
-
-
- _('Conversation feed (RSS 2.0)')),
- new Feed(Feed::ATOM,
- common_local_url('apiconversation',
- array(
- 'id' => $this->conv->id,
- 'format' => 'atom')),
-
-
- _('Conversation feed (Activity Streams JSON)')));
- }
- }
|