1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-11 16:32:55 +00:00

Prepare an APIv2 call to improve sync performance on phone (battery)

This commit is contained in:
Loic Blot
2014-11-30 18:05:20 +00:00
parent 5f0263f71e
commit f89a23c205
2 changed files with 27 additions and 1 deletions
+14
View File
@@ -80,6 +80,20 @@ class SmsController extends Controller {
return new JSONResponse(array("smslist" => $smsList));
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* This function is used by API v2
* Phone will get this ID to push recent messages
* This call will be used combined with retrieveAllIds
* but will be used more times
*/
public function retrieveLastTimestamp () {
$ts = $this->smsMapper->getLastTimestamp($this->userId);
return new JSONResponse(array("timestamp" => $ts));
}
/**
* @NoAdminRequired
* @NoCSRFRequired