Merge pull request #39553 from zero0cool0/fix/caldavbackend_getChangesForCalendar

This commit is contained in:
John Molakvoæ 2024-02-23 21:35:43 +01:00 committed by GitHub
commit 9eece36235
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2347,11 +2347,13 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
* @return array
*/
public function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null, $calendarType = self::CALENDAR_TYPE_CALENDAR) {
return $this->atomic(function () use ($calendarId, $syncToken, $syncLevel, $limit, $calendarType) {
$table = $calendarType === self::CALENDAR_TYPE_CALENDAR ? 'calendars': 'calendarsubscriptions';
return $this->atomic(function () use ($calendarId, $syncToken, $syncLevel, $limit, $calendarType, $table) {
// Current synctoken
$qb = $this->db->getQueryBuilder();
$qb->select('synctoken')
->from('calendars')
->from($table)
->where(
$qb->expr()->eq('id', $qb->createNamedParameter($calendarId))
);