X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Freplies.php;h=4c6fba9ece7206d0cc16c805e41b740a5481baef;hb=0af75a5a2a9a62826594b7526aa7749ab7844b62;hp=54109b7b9f40f731f7e428d8ff1960353248a36a;hpb=36b331d469b6dcd1101783f21265f7be624bc58f;p=quix0rs-gnu-social.git diff --git a/actions/replies.php b/actions/replies.php index 54109b7b9f..4c6fba9ece 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -22,7 +22,7 @@ * @category Personal * @package StatusNet * @author Evan Prodromou - * @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/ */ @@ -44,7 +44,7 @@ require_once INSTALLDIR.'/lib/feedlist.php'; * @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; @@ -65,7 +65,7 @@ class RepliesAction extends OwnerDesignAction $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. @@ -76,7 +76,7 @@ class RepliesAction extends OwnerDesignAction $profile = $this->user->getProfile(); if (!$profile) { - // TRANS: Server error displayed when trying to reply to a user without a profile. + // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); return false; } @@ -85,8 +85,11 @@ class RepliesAction extends OwnerDesignAction common_set_returnto($this->selfUrl()); - $this->notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE, - NOTICES_PER_PAGE + 1); + $stream = new ReplyNoticeStream($this->user->id, + Profile::current()); + + $this->notice = $stream->getNotices(($this->page-1) * NOTICES_PER_PAGE, + NOTICES_PER_PAGE + 1); if($this->page > 1 && $this->notice->N == 0){ // TRANS: Server error when page not found (404) @@ -140,7 +143,16 @@ class RepliesAction extends OwnerDesignAction */ 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.