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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user