X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fallrss.php;h=637352bf4b32f28da288f0a147dea703c48d80cd;hb=018fd840329a64a7266acc89f76a9327c4f7a849;hp=0114c43962ad312075337ef347010fada0c25a1b;hpb=34a61b40f47a52d1fdcf7cd907f3ac53b96b038e;p=quix0rs-gnu-social.git diff --git a/actions/allrss.php b/actions/allrss.php index 0114c43962..637352bf4b 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -1,19 +1,18 @@ - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -29,7 +28,7 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,11 +40,11 @@ require_once INSTALLDIR.'/lib/rssaction.php'; * Formatting of RSS handled by Rss10Action * * @category Action - * @package Laconica - * @author Evan Prodromou - * @author Robin Millette + * @package StatusNet + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class AllrssAction extends Rss10Action { @@ -57,17 +56,20 @@ class AllrssAction extends Rss10Action * @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 { + $this->notices = $this->getNotices($this->limit); return true; } } @@ -81,8 +83,10 @@ class AllrssAction extends Rss10Action */ function getNotices($limit=0) { - $user = $this->user; - $notice = $user->noticesWithFriends(0, $limit); + $stream = new InboxNoticeStream($this->user->getProfile()); + $notice = $stream->getNotices(0, $limit, null, null); + + $notices = array(); while ($notice->fetch()) { $notices[] = clone($notice); @@ -102,12 +106,14 @@ 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)), - 'description' => sprintf(_('Feed for friends of %s'), - $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; } @@ -115,7 +121,7 @@ class AllrssAction extends Rss10Action * Get image. * * @return string user avatar URL or null - */ + */ function getImage() { $user = $this->user; @@ -123,8 +129,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); } } -