mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-06 23:46:18 +00:00
Add last_id field to fetchmessage functions
This commit is contained in:
parent
875519d603
commit
8d335d449e
@ -194,7 +194,9 @@ class ApiController extends Controller {
|
||||
return new JSONResponse(array("msg" => "Too many messages requested"), 413);
|
||||
}
|
||||
|
||||
return new JSONResponse(array("messages" => $this->smsMapper->getMessages($this->userId, $start, $limit)));
|
||||
$messages = $this->smsMapper->getMessages($this->userId, $start, $limit);
|
||||
|
||||
return new JSONResponse(array("messages" => $messages, "last_id" => max(array_keys($messages))));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -213,7 +215,7 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
// @TODO because multiple phone numbers can be same number with different formatting
|
||||
return new JSONResponse(array("messages" => array()));
|
||||
return new JSONResponse(array("messages" => array(), "last_id" => 0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user