3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2008, 2009, StatusNet, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if (!defined('GNUSOCIAL')) { exit(1); }
22 // Formatting of RSS handled by Rss10Action
24 class UserrssAction extends TargetedRss10Action
26 protected $tag = null;
28 protected function doStreamPreparation()
30 parent::doStreamPreparation();
32 $this->tag = $this->trimmed('tag');
35 protected function getNotices()
37 if (!empty($this->tag)) {
38 $stream = $this->getTarget()->getTaggedNotices($this->tag, 0, $this->limit);
39 return $stream->fetchAll();
41 // otherwise we fetch a normal user stream
43 $stream = $this->getTarget()->getNotices(0, $this->limit);
44 return $stream->fetchAll();
49 $c = array('url' => common_local_url('userrss',
51 $this->target->getNickname())),
52 // TRANS: Message is used as link title. %s is a user nickname.
53 'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
54 'link' => $this->target->getUrl(),
55 // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
56 'description' => sprintf(_('Updates from %1$s on %2$s!'),
57 $this->target->getNickname(), common_config('site', 'name')));
61 // override parent to add X-SUP-ID URL
65 $url = common_local_url('sup', null, null, $this->target->getID());
66 header('X-SUP-ID: '.$url);
70 function isReadOnly($args)