1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-12 18:36:32 +00:00

add missing return for getAllIds and prevent duplicate IDs

This commit is contained in:
Loic Blot 2014-09-15 18:44:31 +00:00
parent fb0083a28a
commit dd67fed01a

View File

@ -31,9 +31,13 @@ class SmsMapper extends Mapper {
if (!isset($smsList[$mbox])) { if (!isset($smsList[$mbox])) {
$smsList[$mbox] = array(); $smsList[$mbox] = array();
} }
if (!in_array($row["sms_id"], $smsList[$mbox])) {
array_push($smsList[$mbox], $row["sms_id"]); array_push($smsList[$mbox], $row["sms_id"]);
} }
} }
return $smsList;
}
public function writeToDB ($userId, $smsList, $purgeAllSmsBeforeInsert = false) { public function writeToDB ($userId, $smsList, $purgeAllSmsBeforeInsert = false) {
\OCP\DB::beginTransaction(); \OCP\DB::beginTransaction();