mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 16:14:26 +02:00
Inherit ApiResponse
from Response
This commit is contained in:
parent
561aba18e3
commit
537b74f307
46 changed files with 326 additions and 277 deletions
|
@ -42,13 +42,15 @@ class Setseen extends BaseApi
|
|||
// return error if id is zero
|
||||
if (empty($request['id'])) {
|
||||
$answer = ['result' => 'error', 'message' => 'message id not specified'];
|
||||
DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
return;
|
||||
}
|
||||
|
||||
// error message if specified id is not in database
|
||||
if (!DBA::exists('mail', ['id' => $request['id'], 'uid' => $uid])) {
|
||||
$answer = ['result' => 'error', 'message' => 'message id not in database'];
|
||||
DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
return;
|
||||
}
|
||||
|
||||
// update seen indicator
|
||||
|
@ -58,6 +60,6 @@ class Setseen extends BaseApi
|
|||
$answer = ['result' => 'error', 'message' => 'unknown error'];
|
||||
}
|
||||
|
||||
DI::apiResponse()->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
$this->response->exit('direct_messages_setseen', ['$result' => $answer], $this->parameters['extension'] ?? null);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue