X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapitimelinegroup.php;h=de13e7eb9871b95c3ed5d90b869aa236db08e200;hb=1cc10aaef63830ead662d8a962373554a949c951;hp=9d6ac6ad1894e48ddd2e8a4c650dd931c3ee575c;hpb=bb08611def2309711f91c1ab6cdab92fb7c069b2;p=quix0rs-gnu-social.git diff --git a/actions/apitimelinegroup.php b/actions/apitimelinegroup.php index 9d6ac6ad18..de13e7eb98 100644 --- a/actions/apitimelinegroup.php +++ b/actions/apitimelinegroup.php @@ -21,6 +21,9 @@ * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -31,19 +34,22 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/api.php'; +require_once INSTALLDIR . '/lib/apiprivateauth.php'; /** * Returns the most recent notices (default 20) posted to the group specified by ID * * @category API * @package StatusNet + * @author Craig Andrews + * @author Evan Prodromou + * @author Jeffery To * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class ApiTimelineGroupAction extends ApiAction +class ApiTimelineGroupAction extends ApiPrivateAuthAction { var $group = null; @@ -62,16 +68,7 @@ class ApiTimelineGroupAction extends ApiAction { parent::prepare($args); - $this->page = (int)$this->arg('page', 1); - $this->count = (int)$this->arg('count', 20); - $this->max_id = (int)$this->arg('max_id', 0); - $this->since_id = (int)$this->arg('since_id', 0); - $this->since = $this->arg('since'); - - $this->group = $this->getTargetGroup($this->arg('id')); - - $this->format = $this->arg('format'); - $this->notices = $this->getNotices(); + $this->group = $this->getTargetGroup($this->arg('id')); return true; } @@ -89,6 +86,13 @@ class ApiTimelineGroupAction extends ApiAction function handle($args) { parent::handle($args); + + if (empty($this->group)) { + $this->clientError(_('Group not found!'), 404, $this->format); + return false; + } + + $this->notices = $this->getNotices(); $this->showTimeline(); } @@ -116,16 +120,16 @@ class ApiTimelineGroupAction extends ApiAction switch($this->format) { case 'xml': - $this->show_xml_timeline($this->notices); + $this->showXmlTimeline($this->notices); break; case 'rss': - $this->show_rss_timeline($this->notices, $title, $link, $subtitle); + $this->showRssTimeline($this->notices, $title, $link, $subtitle); break; case 'atom': $selfuri = common_root_url() . 'api/statusnet/groups/timeline/' . $this->group->nickname . '.atom'; - $this->show_atom_timeline( + $this->showAtomTimeline( $this->notices, $title, $id, @@ -136,7 +140,7 @@ class ApiTimelineGroupAction extends ApiAction ); break; case 'json': - $this->show_json_timeline($this->notices); + $this->showJsonTimeline($this->notices); break; default: $this->clientError(