From 6317f7d92bf94f8563a7d9392631d0da06b3042b Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 27 May 2010 18:26:47 -0400 Subject: Assigning my copyrights to the Free Software Foundation --- actions/apistatusesdestroy.php | 1 + 1 file changed, 1 insertion(+) (limited to 'actions/apistatusesdestroy.php') diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index f7d52f020..250b4236b 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -29,6 +29,7 @@ * @author Robin Millette * @author Zach Copley * @copyright 2009 StatusNet, Inc. + * @copyright 2009 Free Software Foundation, Inc http://www.fsf.org * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -- cgit v1.2.3-54-g00ecf From cef302cacdf86d1c82f7937d2901f9254c88bf8a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 28 May 2010 06:22:12 +0000 Subject: Bugfix: api/statuses/destroy.:format was outputting deleted notice twice, causing parsers to fail. --- actions/apistatusesdestroy.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'actions/apistatusesdestroy.php') diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index f7d52f020..0bfcdd060 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -57,7 +57,7 @@ require_once INSTALLDIR . '/lib/apiauth.php'; class ApiStatusesDestroyAction extends ApiAuthAction { - var $status = null; + var $status = null; /** * Take arguments for running @@ -120,18 +120,11 @@ class ApiStatusesDestroyAction extends ApiAuthAction $replies->get('notice_id', $this->notice_id); $replies->delete(); $this->notice->delete(); - - if ($this->format == 'xml') { - $this->showSingleXmlStatus($this->notice); - } elseif ($this->format == 'json') { - $this->show_single_json_status($this->notice); - } + $this->showNotice(); } else { $this->clientError(_('You may not delete another user\'s status.'), 403, $this->format); } - - $this->showNotice(); } /** -- cgit v1.2.3-54-g00ecf From 4bbb259baf93780556db398f50a22b6f245071e4 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 3 Jun 2010 10:52:16 -0700 Subject: - Fix bad argument being passed (error code) when invalid format specified - Reformat whitespace --- actions/apistatusesdestroy.php | 59 +++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 24 deletions(-) (limited to 'actions/apistatusesdestroy.php') diff --git a/actions/apistatusesdestroy.php b/actions/apistatusesdestroy.php index 0bfcdd060..749f72e68 100644 --- a/actions/apistatusesdestroy.php +++ b/actions/apistatusesdestroy.php @@ -99,32 +99,43 @@ class ApiStatusesDestroyAction extends ApiAuthAction parent::handle($args); if (!in_array($this->format, array('xml', 'json'))) { - $this->clientError(_('API method not found.'), $code = 404); - return; + $this->clientError( + _('API method not found.'), + 404 + ); + return; } - if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { - $this->clientError(_('This method requires a POST or DELETE.'), - 400, $this->format); - return; - } - - if (empty($this->notice)) { - $this->clientError(_('No status found with that ID.'), - 404, $this->format); - return; - } - - if ($this->user->id == $this->notice->profile_id) { - $replies = new Reply; - $replies->get('notice_id', $this->notice_id); - $replies->delete(); - $this->notice->delete(); - $this->showNotice(); - } else { - $this->clientError(_('You may not delete another user\'s status.'), - 403, $this->format); - } + if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { + $this->clientError( + _('This method requires a POST or DELETE.'), + 400, + $this->format + ); + return; + } + + if (empty($this->notice)) { + $this->clientError( + _('No status found with that ID.'), + 404, $this->format + ); + return; + } + + if ($this->user->id == $this->notice->profile_id) { + $replies = new Reply; + $replies->get('notice_id', $this->notice_id); + $replies->delete(); + $this->notice->delete(); + $this->showNotice(); + } else { + $this->clientError( + _('You may not delete another user\'s status.'), + 403, + $this->format + ); + } } /** -- cgit v1.2.3-54-g00ecf