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('STATUSNET') && !defined('LACONICA')) { exit(1); }
22 require_once(INSTALLDIR.'/lib/rssaction.php');
24 // Formatting of RSS handled by Rss10Action
26 class UserrssAction extends Rss10Action
30 function prepare($args)
32 parent::prepare($args);
33 $nickname = $this->trimmed('nickname');
34 $this->user = User::getKV('nickname', $nickname);
35 $this->tag = $this->trimmed('tag');
38 // TRANS: Client error displayed when user not found for an action.
39 $this->clientError(_('No such user.'));
42 if (!empty($this->tag)) {
43 $this->notices = $this->getTaggedNotices();
45 $this->notices = $this->getNotices();
51 function getTaggedNotices()
53 $notice = $this->user->getTaggedNotices(
56 ($this->limit == 0) ? NOTICES_PER_PAGE : $this->limit,
62 while ($notice->fetch()) {
63 $notices[] = clone($notice);
72 $notice = $this->user->getNotices(
74 ($this->limit == 0) ? NOTICES_PER_PAGE : $this->limit
78 while ($notice->fetch()) {
79 $notices[] = clone($notice);
88 $profile = $user->getProfile();
89 $c = array('url' => common_local_url('userrss',
92 // TRANS: Message is used as link title. %s is a user nickname.
93 'title' => sprintf(_('%s timeline'), $user->nickname),
94 'link' => $profile->profileurl,
95 // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
96 'description' => sprintf(_('Updates from %1$s on %2$s!'),
97 $user->nickname, common_config('site', 'name')));
103 $profile = $this->user->getProfile();
104 return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
107 // override parent to add X-SUP-ID URL
109 function initRss($limit=0)
111 $url = common_local_url('sup', null, null, $this->user->id);
112 header('X-SUP-ID: '.$url);
113 parent::initRss($limit);
116 function isReadOnly($args)