3 * StatusNet, the distributed open-source microblogging tool
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@status.net>
25 * @author Sarven Capadisli <csarven@status.net>
26 * @copyright 2008-2009 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('GNUSOCIAL')) { exit(1); }
33 define('MEMBERS_PER_SECTION', 27);
40 * @author Evan Prodromou <evan@status.net>
41 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
42 * @link http://status.net/
44 class GroupRssAction extends TargetedRss10Action
46 /** group we're viewing. */
47 protected $group = null;
50 * Is this page read-only?
52 * @return boolean true
54 function isReadOnly($args)
59 protected function doStreamPreparation()
62 $nickname_arg = $this->arg('nickname');
63 $nickname = common_canonical_nickname($nickname_arg);
65 // Permanent redirect on non-canonical nickname
67 if ($nickname_arg != $nickname) {
68 $args = array('nickname' => $nickname);
69 common_redirect(common_local_url('showgroup', $args), 301);
73 // TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname.
74 $this->clientError(_('No nickname.'), 404);
77 $local = Local_group::getKV('nickname', $nickname);
79 if (!$local instanceof Local_group) {
80 // TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
81 $this->clientError(_('No such group.'), 404);
84 $this->group = $local->getGroup();
85 $this->target = $this->group->getProfile();
88 protected function getNotices()
90 $stream = $this->group->getNotices(0, $this->limit);
91 return $stream->fetchAll();
96 $c = array('url' => common_local_url('grouprss',
98 $this->target->getNickname())),
99 // TRANS: Message is used as link title. %s is a user nickname.
100 'title' => sprintf(_('%s timeline'), $this->target->getNickname()),
101 'link' => common_local_url('showgroup', array('nickname' => $this->target->getNickname())),
102 // TRANS: Message is used as link description. %1$s is a group name, %2$s is a site name.
103 'description' => sprintf(_('Updates from members of %1$s on %2$s!'),
104 $this->target->getNickname(), common_config('site', 'name')));
110 return $this->group->homepage_logo;