X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgrouprss.php;h=490f6f945cac57b509f968b3f771aea5b3f3c5c5;hb=72460091ddc6763cb8d62f9d865390ea4973dd44;hp=de76a59600dbb67d409c44bf434784b3d62e04f0;hpb=bab3e1b8586f42bc1f0a5f96b6990d67c6b74446;p=quix0rs-gnu-social.git diff --git a/actions/grouprss.php b/actions/grouprss.php index de76a59600..490f6f945c 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); } require_once INSTALLDIR.'/lib/rssaction.php'; -define('MEMBERS_PER_SECTION', 81); +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 @@ -57,7 +57,7 @@ class groupRssAction extends Rss10Action * @return boolean true */ - function isReadOnly() + function isReadOnly($args) { return true; } @@ -76,11 +76,6 @@ class groupRssAction extends Rss10Action { 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); @@ -93,17 +88,25 @@ class groupRssAction extends Rss10Action } if (!$nickname) { - $this->clientError(_('No nickname'), 404); + $this->clientError(_('No nickname.'), 404); + return false; + } + + $local = Local_group::staticGet('nickname', $nickname); + + if (!$local) { + $this->clientError(_('No such group.'), 404); return false; } - $this->group = User_group::staticGet('nickname', $nickname); + $this->group = User_group::staticGet('id', $local->group_id); if (!$this->group) { - $this->clientError(_('No such group'), 404); + $this->clientError(_('No such group.'), 404); return false; } + $this->notices = $this->getNotices($this->limit); return true; } @@ -116,6 +119,7 @@ class groupRssAction extends Rss10Action return null; } + $notices = array(); $notice = $group->getNotices(0, ($limit == 0) ? NOTICES_PER_PAGE : $limit); while ($notice->fetch()) { @@ -131,9 +135,10 @@ class groupRssAction extends Rss10Action $c = array('url' => common_local_url('grouprss', array('nickname' => $group->nickname)), - 'title' => $group->nickname, + 'title' => sprintf(_('%s timeline'), $group->nickname), 'link' => common_local_url('showgroup', array('nickname' => $group->nickname)), - 'description' => sprintf(_('Microblog by %s group'), $group->nickname)); + 'description' => sprintf(_('Updates from members of %1$s on %2$s!'), + $group->nickname, common_config('site', 'name'))); return $c; }