'OCA\\DAV\\Direct\\DirectHome' => $baseDir . '/../lib/Direct/DirectHome.php',
'OCA\\DAV\\Direct\\Server' => $baseDir . '/../lib/Direct/Server.php',
'OCA\\DAV\\Direct\\ServerFactory' => $baseDir . '/../lib/Direct/ServerFactory.php',
+ 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => $baseDir . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => $baseDir . '/../lib/Files/BrowserErrorPagePlugin.php',
'OCA\\DAV\\Files\\FileSearchBackend' => $baseDir . '/../lib/Files/FileSearchBackend.php',
'OCA\\DAV\\Files\\FilesHome' => $baseDir . '/../lib/Files/FilesHome.php',
'OCA\\DAV\\Direct\\DirectHome' => __DIR__ . '/..' . '/../lib/Direct/DirectHome.php',
'OCA\\DAV\\Direct\\Server' => __DIR__ . '/..' . '/../lib/Direct/Server.php',
'OCA\\DAV\\Direct\\ServerFactory' => __DIR__ . '/..' . '/../lib/Direct/ServerFactory.php',
+ 'OCA\\DAV\\Exception\\UnsupportedLimitOnInitialSyncException' => __DIR__ . '/..' . '/../lib/Exception/UnsupportedLimitOnInitialSyncException.php',
'OCA\\DAV\\Files\\BrowserErrorPagePlugin' => __DIR__ . '/..' . '/../lib/Files/BrowserErrorPagePlugin.php',
'OCA\\DAV\\Files\\FileSearchBackend' => __DIR__ . '/..' . '/../lib/Files/FileSearchBackend.php',
'OCA\\DAV\\Files\\FilesHome' => __DIR__ . '/..' . '/../lib/Files/FilesHome.php',
*/
namespace OCA\DAV\CalDAV;
+use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException;
use Sabre\CalDAV\Backend\BackendInterface;
use Sabre\DAV\Exception\MethodNotAllowed;
use Sabre\DAV\Exception\NotFound;
public function calendarQuery(array $filters):array {
return $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters, CalDavBackend::CALENDAR_TYPE_SUBSCRIPTION);
}
+
+ /**
+ * @inheritDoc
+ */
+ public function getChanges($syncToken, $syncLevel, $limit = null) {
+ if (!$syncToken && $limit) {
+ throw new UnsupportedLimitOnInitialSyncException();
+ }
+
+ return parent::getChanges($syncToken, $syncLevel, $limit);
+ }
}
namespace OCA\DAV\CalDAV;
use OCA\DAV\DAV\Sharing\IShareable;
+use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException;
use OCP\IConfig;
use OCP\IL10N;
use Sabre\CalDAV\Backend\BackendInterface;
return isset($this->calendarInfo['{http://calendarserver.org/ns/}source']);
}
+ /**
+ * @inheritDoc
+ */
+ public function getChanges($syncToken, $syncLevel, $limit = null) {
+ if (!$syncToken && $limit) {
+ throw new UnsupportedLimitOnInitialSyncException();
+ }
+
+ return parent::getChanges($syncToken, $syncLevel, $limit);
+ }
}
namespace OCA\DAV\CardDAV;
use OCA\DAV\DAV\Sharing\IShareable;
+use OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException;
use OCP\IL10N;
use Sabre\CardDAV\Backend\BackendInterface;
use Sabre\CardDAV\Card;
}
return true;
}
+
+ public function getChanges($syncToken, $syncLevel, $limit = null) {
+ if (!$syncToken && $limit) {
+ throw new UnsupportedLimitOnInitialSyncException();
+ }
+
+ return parent::getChanges($syncToken, $syncLevel, $limit);
+ }
}
$query = "SELECT `uri`, `operation` FROM `*PREFIX*addressbookchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `addressbookid` = ? ORDER BY `synctoken`";
if ($limit>0) {
- $query .= " `LIMIT` " . (int)$limit;
+ $query .= " LIMIT " . (int)$limit;
}
// Fetching all changes
--- /dev/null
+<?php
+
+/**
+ * @copyright Copyright (c) 2019 Georg Ehrke
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+namespace OCA\DAV\Exception;
+
+use Sabre\DAV\Exception\InsufficientStorage;
+use Sabre\DAV\Server;
+
+/**
+ * Class UnsupportedLimitOnInitialSyncException
+ *
+ * @package OCA\DAV\Exception
+ */
+class UnsupportedLimitOnInitialSyncException extends InsufficientStorage {
+
+ /**
+ * @inheritDoc
+ */
+ public function serialize(Server $server, \DOMElement $errorNode) {
+ $errorNode->appendChild($errorNode->ownerDocument->createElementNS('DAV:', 'd:number-of-matches-within-limits'));
+ }
+}