summaryrefslogtreecommitdiff
path: root/actions/twitapidirect_messages.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-01-15 23:03:38 +0000
committerEvan Prodromou <evan@controlyourself.ca>2009-01-15 23:03:38 +0000
commit4b0cf99e56f965e10eeb8b8b19e7b405bda49eaf (patch)
tree094c2948648d79290326130f9cd75a95afc6035d /actions/twitapidirect_messages.php
parenteaa81d25fa7bd954132ce7f901fae69b0d46ec1a (diff)
Convert use of common_server_error and common_user_error to methods on Action
Diffstat (limited to 'actions/twitapidirect_messages.php')
-rw-r--r--actions/twitapidirect_messages.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php
index 36d2a7e09..db55e8cd0 100644
--- a/actions/twitapidirect_messages.php
+++ b/actions/twitapidirect_messages.php
@@ -108,7 +108,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction
$this->show_json_dmsgs($message);
break;
default:
- common_user_error(_('API method not found!'), $code = 404);
+ $this->clientError(_('API method not found!'), $code = 404);
}
}
@@ -119,7 +119,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction
parent::handle($args);
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
- $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']);
+ $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']);
return;
}
@@ -134,11 +134,11 @@ class Twitapidirect_messagesAction extends TwitterapiAction
$content = $this->trimmed('text');
if (!$content) {
- $this->client_error(_('No message text!'), $code = 406, $apidata['content-type']);
+ $this->clientError(_('No message text!'), $code = 406, $apidata['content-type']);
} else {
$content_shortened = common_shorten_links($content);
if (mb_strlen($content_shortened) > 140) {
- $this->client_error(_('That\'s too long. Max message size is 140 chars.'),
+ $this->clientError(_('That\'s too long. Max message size is 140 chars.'),
$code = 406, $apidata['content-type']);
return;
}
@@ -147,15 +147,15 @@ class Twitapidirect_messagesAction extends TwitterapiAction
$other = $this->get_user($this->trimmed('user'));
if (!$other) {
- $this->client_error(_('Recipient user not found.'), $code = 403, $apidata['content-type']);
+ $this->clientError(_('Recipient user not found.'), $code = 403, $apidata['content-type']);
return;
} else if (!$user->mutuallySubscribed($other)) {
- $this->client_error(_('Can\'t send direct messages to users who aren\'t your friend.'),
+ $this->clientError(_('Can\'t send direct messages to users who aren\'t your friend.'),
$code = 403, $apidata['content-type']);
return;
} else if ($user->id == $other->id) {
// Sending msgs to yourself is allowed by Twitter
- $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'),
+ $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'),
$code = 403, $apidata['content-type']);
return;
}
@@ -164,7 +164,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction
html_entity_decode($content, ENT_NOQUOTES, 'UTF-8'), $source);
if (is_string($message)) {
- $this->server_error($message);
+ $this->serverError($message);
return;
}
@@ -181,7 +181,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction
function destroy($args, $apidata)
{
parent::handle($args);
- common_server_error(_('API method under construction.'), $code=501);
+ $this->serverError(_('API method under construction.'), $code=501);
}
function show_xml_dmsgs($message)