4 * RSS feed for user and friends timeline action class.
10 * @author Evan Prodromou <evan@controlyourself.ca>
11 * @author Robin Millette <millette@controlyourself.ca>
12 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
13 * @link http://laconi.ca/
15 * Laconica - a distributed open-source microblogging tool
16 * Copyright (C) 2008, 2009, Control Yourself, Inc.
18 * This program is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Affero General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU Affero General Public License for more details.
28 * You should have received a copy of the GNU Affero General Public License
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32 if (!defined('LACONICA')) {
36 require_once INSTALLDIR.'/lib/rssaction.php';
39 * RSS feed for user and friends timeline.
41 * Formatting of RSS handled by Rss10Action
45 * @author Evan Prodromou <evan@controlyourself.ca>
46 * @author Robin Millette <millette@controlyourself.ca>
47 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
48 * @link http://laconi.ca/
50 class AllrssAction extends Rss10Action
57 * @param array $args Web and URL arguments
59 * @return boolean false if user doesn't exist
61 function prepare($args)
63 parent::prepare($args);
64 $nickname = $this->trimmed('nickname');
65 $this->user = User::staticGet('nickname', $nickname);
68 $this->clientError(_('No such user.'));
78 * @param integer $limit max number of notices to return
80 * @return array notices
82 function getNotices($limit=0)
84 $cur = common_current_user();
86 if (!empty($cur) && $cur->id == $user->id) {
87 $notice = $this->user->noticeInbox(0, $limit);
89 $notice = $this->user->noticesWithFriends(0, $limit);
93 $notice = $user->noticesWithFriends(0, $limit);
96 while ($notice->fetch()) {
97 $notices[] = clone($notice);
106 * @return array associative array on channel information
108 function getChannel()
111 $c = array('url' => common_local_url('allrss',
114 'title' => sprintf(_('%s and friends'), $user->nickname),
115 'link' => common_local_url('all',
118 'description' => sprintf(_('Feed for friends of %s'),
126 * @return string user avatar URL or null
131 $profile = $user->getProfile();
135 $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
136 return $avatar ? $avatar->url : null;