* @category Personal
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
- * @copyright 2008-2009 StatusNet, Inc.
+ * @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-class RepliesAction extends OwnerDesignAction
+class RepliesAction extends Action
{
var $page = null;
var $notice;
$nickname = common_canonical_nickname($this->arg('nickname'));
- $this->user = User::staticGet('nickname', $nickname);
+ $this->user = User::getKV('nickname', $nickname);
if (!$this->user) {
// TRANS: Client error displayed when trying to reply to a non-exsting user.
$this->clientError(_('No such user.'));
- return false;
}
$profile = $this->user->getProfile();
if (!$profile) {
// TRANS: Error message displayed when referring to a user without a profile.
$this->serverError(_('User has no profile.'));
- return false;
}
$this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
NOTICES_PER_PAGE + 1);
if($this->page > 1 && $this->notice->N == 0){
- // TRANS: Server error when page not found (404)
- $this->serverError(_('No such page.'),$code=404);
+ // TRANS: Client error when page not found (404)
+ $this->clientError(_('No such page.'), 404);
}
return true;
*/
function getFeeds()
{
- return array(new Feed(Feed::RSS1,
+ return array(new Feed(Feed::JSON,
+ common_local_url('ApiTimelineMentions',
+ array(
+ 'id' => $this->user->nickname,
+ 'format' => 'as')),
+ // TRANS: Link for feed with replies for a user.
+ // TRANS: %s is a user nickname.
+ sprintf(_('Replies feed for %s (Activity Streams JSON)'),
+ $this->user->nickname)),
+ new Feed(Feed::RSS1,
common_local_url('repliesrss',
array('nickname' => $this->user->nickname)),
// TRANS: Link for feed with replies for a user.
*/
function showContent()
{
- $nl = new NoticeList($this->notice, $this);
+ $nl = new PrimaryNoticeList($this->notice, $this, array('show_n'=>NOTICES_PER_PAGE));
$cnt = $nl->show();
if (0 === $cnt) {