<?php
-
/**
* RSS feed for user and friends timeline action class.
*
* @param array $args Web and URL arguments
*
* @return boolean false if user doesn't exist
+ *
*/
function prepare($args)
{
parent::prepare($args);
$nickname = $this->trimmed('nickname');
- $this->user = User::staticGet('nickname', $nickname);
+ $this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
+ // TRANS: Client error when user not found for an rss related action.
$this->clientError(_('No such user.'));
return false;
} else {
*/
function getNotices($limit=0)
{
- $cur = common_current_user();
-
- if (!empty($cur) && $cur->id == $user->id) {
- $notice = $this->user->noticeInbox(0, $limit);
- } else {
- $notice = $this->user->noticesWithFriends(0, $limit);
- }
+ $stream = new InboxNoticeStream($this->user);
+ $notice = $stream->getNotices(0, $limit, null, null);
- $user = $this->user;
- $notice = $user->noticesWithFriends(0, $limit);
$notices = array();
while ($notice->fetch()) {
$c = array('url' => common_local_url('allrss',
array('nickname' =>
$user->nickname)),
+ // TRANS: Message is used as link title. %s is a user nickname.
'title' => sprintf(_('%s and friends'), $user->nickname),
'link' => common_local_url('all',
array('nickname' =>
$user->nickname)),
+ // TRANS: Message is used as link description. %1$s is a username, %2$s is a site name.
'description' => sprintf(_('Updates from %1$s and friends on %2$s!'),
$user->nickname, common_config('site', 'name')));
return $c;
* Get image.
*
* @return string user avatar URL or null
- */
+ */
function getImage()
{
$user = $this->user;
if (!$profile) {
return null;
}
- $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
- return $avatar ? $avatar->url : null;
+ return $profile->avatarUrl(AVATAR_PROFILE_SIZE);
}
}
-