X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fallrss.php;h=fee52c79ab3c7301f307865c6504b12ec39d6d5e;hb=0a20abf1d8a9a068df9310d6903cc303f39b25ed;hp=01e737ad7bb65300df8b166dd39eb6351b2deada;hpb=0994589b7389caa609f9b93e7c1572463b7dca36;p=quix0rs-gnu-social.git diff --git a/actions/allrss.php b/actions/allrss.php index 01e737ad7b..fee52c79ab 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -1,5 +1,4 @@ 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 { $this->notices = $this->getNotices($this->limit); return true; @@ -82,16 +82,9 @@ class AllrssAction extends Rss10Action */ function getNotices($limit=0) { - $cur = common_current_user(); - $user = $this->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->getProfile()); + $notice = $stream->getNotices(0, $limit, null, null); - $notice = $user->noticesWithFriends(0, $limit); $notices = array(); while ($notice->fetch()) { @@ -112,10 +105,12 @@ class AllrssAction extends Rss10Action $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; @@ -125,7 +120,7 @@ class AllrssAction extends Rss10Action * Get image. * * @return string user avatar URL or null - */ + */ function getImage() { $user = $this->user; @@ -133,8 +128,6 @@ class AllrssAction extends Rss10Action if (!$profile) { return null; } - $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - return $avatar ? $avatar->url : null; + return $profile->avatarUrl(AVATAR_PROFILE_SIZE); } } -