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

Change protocol. We receive a mailbox ID, drafts are contained into this mailbox ID.

This commit is contained in:
Loïc Blot (@U-Exp)
2014-09-12 19:42:54 +02:00
parent 5cef955d23
commit 0132ca90db
4 changed files with 19 additions and 13 deletions
+7 -6
View File
@@ -60,20 +60,23 @@ class SmsController extends Controller {
foreach ($smsDatas as &$sms) {
if (!array_key_exists("_id", $sms) || !array_key_exists("read", $sms) ||
!array_key_exists("date", $sms) || !array_key_exists("seen", $sms) ||
!array_key_exists("mbox", $sms) ||
!array_key_exists("body", $sms) || !array_key_exists("address", $sms)) {
$this->errorMsg = "Error: bad SMS entry";
return false;
}
if (!array_key_exists("draft", $sms)) {
$sms["draft"] = "true";
}
if (!is_numeric($sms["_id"])) {
$this->errorMsg = sprintf("Error: Invalid SMS ID '%s'", $sms["_id"]);
return false;
}
if (!is_numeric($sms["mbox"]) && $sms["mbox"] != 0 && $sms["mbox"] != 1 &&
$sms["mbox"] != 2) {
$this->errorMsg = sprintf("Error: Invalid Mailbox ID '%s'", $sms["mbox"]);
return false;
}
if ($sms["read"] !== "true" && $sms["read"] !== "false") {
$this->errorMsg = sprintf("Error: Invalid SMS Read state '%s'", $sms["read"]);
return false;
@@ -98,6 +101,4 @@ class SmsController extends Controller {
}
return true;
}
}