mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-07-23 18:05:33 +00:00
Code cleanup & defer fetchMessagesToSend
This commit is contained in:
parent
467565d41b
commit
065ab9bdee
@ -38,9 +38,8 @@ $application->registerRoutes($this, array('routes' => array(
|
||||
array('name' => 'api#get_all_stored_phone_numbers', 'url' => '/api/v2/phones/list', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages', 'url' => '/api/v2/messages/{start}/{limit}', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages_count', 'url' => '/api/v2/messages/count', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages_for_number', 'url' => '/api/v2/messages/{phonenumber}/{start}/{limit}', 'verb' => 'GET'), // Android APIv2
|
||||
array('name' => 'api#fetch_messages_to_send', 'url' => '/api/v2/messages/sendqueue', 'verb' => 'GET'), // Android APIv2
|
||||
|
||||
// API v3
|
||||
// @TODO future calls to sending calls recorded on the phone
|
||||
array('name' => 'api#fetch_messages_to_send', 'url' => '/api/v3/messages/sendqueue', 'verb' => 'GET'), // Android APIv3
|
||||
)));
|
||||
|
@ -207,26 +207,7 @@ class ApiController extends Controller {
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* APIv2
|
||||
* @param $phoneNumber
|
||||
* @param $start
|
||||
* @param $limit
|
||||
* @return JSONResponse
|
||||
*/
|
||||
public function fetchMessagesForNumber($phoneNumber, $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);
|
||||
}
|
||||
|
||||
// @TODO because multiple phone numbers can be same number with different formatting
|
||||
return new JSONResponse(array("messages" => array(), "last_id" => $start));
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*
|
||||
* APIv2
|
||||
* APIv3
|
||||
*/
|
||||
public function fetchMessagesToSend() {
|
||||
// @TODO
|
||||
|
Loading…
x
Reference in New Issue
Block a user