mirror of
https://github.com/friendica/friendica
synced 2025-04-24 03:10:11 +00:00
Rename ApipResponse->exit* methods to better show their meaning
This commit is contained in:
parent
960171c4e0
commit
642baa1f2a
68 changed files with 88 additions and 88 deletions
|
@ -61,7 +61,7 @@ class Destroy extends BaseApi
|
|||
// error if no id or parenturi specified (for clients posting parent-uri as well)
|
||||
if ($verbose && $id == 0 && $parenturi == "") {
|
||||
$answer = ['result' => 'error', 'message' => 'message id or parenturi not specified'];
|
||||
$this->response->exit('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->addFormattedContent('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class Destroy extends BaseApi
|
|||
if (!$this->dba->exists('mail', ["`uid` = ? AND `id` = ? " . $sql_extra, $uid, $id])) {
|
||||
if ($verbose) {
|
||||
$answer = ['result' => 'error', 'message' => 'message id not in database'];
|
||||
$this->response->exit('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->addFormattedContent('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
return;
|
||||
}
|
||||
throw new BadRequestException('message id not in database');
|
||||
|
@ -85,10 +85,10 @@ class Destroy extends BaseApi
|
|||
if ($result) {
|
||||
// return success
|
||||
$answer = ['result' => 'ok', 'message' => 'message deleted'];
|
||||
$this->response->exit('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->addFormattedContent('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
} else {
|
||||
$answer = ['result' => 'error', 'message' => 'unknown error'];
|
||||
$this->response->exit('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->addFormattedContent('direct_messages_delete', ['direct_messages_delete' => $answer], $this->parameters['extension'] ?? null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue