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

Fix messages/conversation removal sync with contact list and also add atomic delete for messages

This commit is contained in:
Loic Blot
2015-06-25 21:59:59 +00:00
parent 1263af850b
commit 13d5e9ff26
5 changed files with 35 additions and 14 deletions
+5
View File
@@ -16,6 +16,7 @@ use \OCP\IRequest;
use \OCP\AppFramework\Http\TemplateResponse;
use \OCP\AppFramework\Controller;
use \OCP\AppFramework\Http\JSONResponse;
use \OCP\AppFramework\Http;
use \OCA\OcSms\AppInfo\OcSmsApp;
@@ -217,6 +218,10 @@ class SmsController extends Controller {
* @NoCSRFRequired
*/
public function deleteMessage ($messageId, $phoneNumber) {
if (!preg_match('#^[0-9]+$#',$messageId)) {
return new JSONResponse(array(), Http::STATUS_BAD_REQUEST);
}
$this->smsMapper->removeMessage($this->userId, $phoneNumber, $messageId);
return new JSONResponse(array());
}