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 $this->tag = $this->trimmed('tag');
33 protected function getNotices()
35 if (!empty($this->tag)) {
36 $stream = $this->target->getTaggedNotices($this->tag, 0, $this->limit);
37 return $stream->fetchAll();
39 // otherwise we fetch a normal user stream
41 $stream = $this->target->getNotices(0, $this->limit);
42 return $stream->fetchAll();
47 $c = array('url' => common_local_url('userrss',
49 $this->target->getNickname())),
50 // TRANS: Message is used as link title. %s is a user nickname.
51 'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
52 'link' => $this->target->getUrl(),
53 // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
54 'description' => sprintf(_('Updates from %1$s on %2$s!'),
55 $this->target->getNickname(), common_config('site', 'name')));
59 // override parent to add X-SUP-ID URL
63 $url = common_local_url('sup', null, null, $this->target->getID());
64 header('X-SUP-ID: '.$url);
68 function isReadOnly($args)