From 065ab9bdeef6aa8a085e4b7473021e925f551ae0 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 7 Dec 2016 00:11:57 +0100 Subject: [PATCH] Code cleanup & defer fetchMessagesToSend --- appinfo/routes.php | 3 +-- controller/apicontroller.php | 21 +-------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index d691dea..f0d4cb4 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -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 ))); diff --git a/controller/apicontroller.php b/controller/apicontroller.php index 335f183..cd7ab39 100644 --- a/controller/apicontroller.php +++ b/controller/apicontroller.php @@ -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