3 * StatusNet, the distributed open-source microblogging tool
5 * Class for building an in-memory Atom feed for a particular list's
10 * LICENCE: This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 * @author Zach Copley <zach@status.net>
26 * @copyright 2010 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('STATUSNET'))
37 * Class for list notice feeds. May contain a reference to the list.
41 * @author Zach Copley <zach@status.net>
42 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
43 * @link http://status.net/
45 class AtomListNoticeFeed extends AtomNoticeFeed
53 * @param List $list the list for the feed
54 * @param User $cur the current authenticated user, if any
55 * @param boolean $indent flag to turn indenting on or off
59 function __construct($list, $cur = null, $indent = true) {
60 parent::__construct($cur, $indent);
62 $this->tagger = Profile::staticGet('id', $list->tagger);
64 // TRANS: Title in atom list notice feed. %1$s is a list name, %2$s is a tagger's nickname.
65 $title = sprintf(_('Timeline for people in list %1$s by %2$s'), $list->tag, $this->tagger->nickname);
66 $this->setTitle($title);
68 $sitename = common_config('site', 'name');
70 // TRANS: Message is used as a subtitle in atom list notice feed.
71 // TRANS: %1$s is a tagger's nickname, %2$s is a list name, %3$s is a site name.
72 _('Updates from %1$s\'s list %2$s on %3$s!'),
73 $this->tagger->nickname,
77 $this->setSubtitle($subtitle);
79 $avatar = $this->tagger->avatarUrl(AVATAR_PROFILE_SIZE);
80 $this->setLogo($avatar);
82 $this->setUpdated('now');
84 $self = common_local_url('ApiTimelineList',
85 array('user' => $this->tagger->nickname,
89 $this->setSelfLink($self);
91 // FIXME: Stop using activity:subject?
92 $ao = ActivityObject::fromPeopletag($this->list);
94 $this->addAuthorRaw($ao->asString('author').
95 $ao->asString('activity:subject'));
97 $this->addLink($this->list->getUri());