summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-06-07 10:34:00 -0700
committerBrion Vibber <brion@pobox.com>2010-06-07 10:34:00 -0700
commit5a96b9e8052361f8eddecc56decd68d4611ccc19 (patch)
treef4c312f25151ed824c78e5b70e0ffcfed5bb4ee2 /actions
parent41e9dba7297d43b7de0cb7665901869910d1047a (diff)
parent02c68ff5230e505dcfbb1dbd764415db8b8379ee (diff)
Merge branch 'master' of gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'actions')
-rw-r--r--actions/apidirectmessage.php3
-rw-r--r--actions/apistatusesdestroy.php59
-rw-r--r--actions/apiusershow.php2
3 files changed, 38 insertions, 26 deletions
diff --git a/actions/apidirectmessage.php b/actions/apidirectmessage.php
index 53da9e0c6..7a0f46274 100644
--- a/actions/apidirectmessage.php
+++ b/actions/apidirectmessage.php
@@ -232,7 +232,8 @@ class ApiDirectMessageAction extends ApiAuthAction
function showXmlDirectMessages()
{
$this->initDocument('xml');
- $this->elementStart('direct-messages', array('type' => 'array'));
+ $this->elementStart('direct-messages', array('type' => 'array',
+ 'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
foreach ($this->messages as $m) {
$dm_array = $this->directMessageArray($m);
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
+ );
+ }
}
/**
diff --git a/actions/apiusershow.php b/actions/apiusershow.php
index 6c8fad49b..28993102c 100644
--- a/actions/apiusershow.php
+++ b/actions/apiusershow.php
@@ -113,7 +113,7 @@ class ApiUserShowAction extends ApiPrivateAuthAction
if ($this->format == 'xml') {
$this->initDocument('xml');
- $this->showTwitterXmlUser($twitter_user);
+ $this->showTwitterXmlUser($twitter_user, 'user', true);
$this->endDocument('xml');
} elseif ($this->format == 'json') {
$this->initDocument('json');