summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-06-03 14:50:52 -0400
committerEvan Prodromou <evan@status.net>2010-06-03 14:50:52 -0400
commit135b398d4bfd1d680c5ea3600337f79c113ed681 (patch)
treec3a253361491d0df0ee1854adda63acb104fb382 /actions
parenta5de2152672f49ad95f114033ef6bf00ece9a0ab (diff)
parent4bbb259baf93780556db398f50a22b6f245071e4 (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline
Diffstat (limited to 'actions')
-rw-r--r--actions/apistatusesdestroy.php59
1 files changed, 35 insertions, 24 deletions
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
+ );
+ }
}
/**