1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-07-16 22:46:49 +00:00

Simplify fetchMessages response code

This commit is contained in:
Loic Blot 2018-02-10 11:16:48 +01:00
parent 0c23a10e80
commit 7d6e81f0ff
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987

View File

@ -202,7 +202,7 @@ class ApiController extends Controller {
*/
public function fetchMessages($start, $limit) {
if (!is_numeric($start) || !is_numeric($limit) || $start < 0 || $limit <= 0) {
return new JSONResponse(array("msg" => "Invalid request"), \OCP\AppFramework\Http::STATUS_BAD_REQUEST);
return new JSONResponse(array("msg" => "Invalid request"), Http::STATUS_BAD_REQUEST);
}
// Limit messages per fetch to prevent phone garbage collecting due to too many datas