X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=actions%2Fgrouprss.php;h=87e34d73f80eccb6eb9020bd5ac005a606dea475;hb=bf94154c96961a2634881799fb9d2dd0039d2d82;hp=0b7280a11c33648584096b95176eafb63fea7835;hpb=76aa85fe5ef408cecf7c40c0c56d58ff9ac9fcbb;p=quix0rs-gnu-social.git diff --git a/actions/grouprss.php b/actions/grouprss.php index 0b7280a11c..87e34d73f8 100644 --- a/actions/grouprss.php +++ b/actions/grouprss.php @@ -1,6 +1,6 @@ . * * @category Group - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,12 +40,11 @@ define('MEMBERS_PER_SECTION', 27); * Group RSS feed * * @category Group - * @package Laconica - * @author Evan Prodromou + * @package StatusNet + * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ - class groupRssAction extends Rss10Action { /** group we're viewing. */ @@ -56,7 +55,6 @@ class groupRssAction extends Rss10Action * * @return boolean true */ - function isReadOnly($args) { return true; @@ -71,16 +69,10 @@ class groupRssAction extends Rss10Action * * @return boolean success flag */ - function prepare($args) { parent::prepare($args); - if (!common_config('inboxes','enabled')) { - $this->serverError(_('Inboxes must be enabled for groups to work')); - return false; - } - $nickname_arg = $this->arg('nickname'); $nickname = common_canonical_nickname($nickname_arg); @@ -89,33 +81,40 @@ class groupRssAction extends Rss10Action if ($nickname_arg != $nickname) { $args = array('nickname' => $nickname); common_redirect(common_local_url('showgroup', $args), 301); - return false; } if (!$nickname) { - $this->clientError(_('No nickname'), 404); - return false; + // TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname. + $this->clientError(_('No nickname.'), 404); } - $this->group = User_group::staticGet('nickname', $nickname); + $local = Local_group::getKV('nickname', $nickname); + + if (!$local) { + // TRANS: Client error displayed when requesting a group RSS feed for group that does not exist. + $this->clientError(_('No such group.'), 404); + } + + $this->group = User_group::getKV('id', $local->group_id); if (!$this->group) { - $this->clientError(_('No such group'), 404); - return false; + // TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group. + $this->clientError(_('No such group.'), 404); } + $this->notices = $this->getNotices($this->limit); return true; } function getNotices($limit=0) { - $group = $this->group; if (is_null($group)) { return null; } + $notices = array(); $notice = $group->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit); while ($notice->fetch()) { @@ -131,9 +130,12 @@ class groupRssAction extends Rss10Action $c = array('url' => common_local_url('grouprss', array('nickname' => $group->nickname)), - 'title' => $group->nickname, + // TRANS: Message is used as link title. %s is a user nickname. + 'title' => sprintf(_('%s timeline'), $group->nickname), 'link' => common_local_url('showgroup', array('nickname' => $group->nickname)), - 'description' => sprintf(_('Microblog by %s group'), $group->nickname)); + // TRANS: Message is used as link description. %1$s is a group name, %2$s is a site name. + 'description' => sprintf(_('Updates from members of %1$s on %2$s!'), + $group->nickname, common_config('site', 'name'))); return $c; }