Calendar Sync V2

This commit is contained in:
2026-03-11 12:18:02 +01:00
parent 2d5e9541c2
commit a4815fc672
6 changed files with 114 additions and 284 deletions

View File

@@ -147,32 +147,9 @@ class CalDavClient
]);
if ($response === null) {
// Try VTODO filter as well
$body = '<?xml version="1.0" encoding="utf-8" ?>' .
'<C:calendar-query xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">' .
'<D:prop>' .
'<D:getetag/>' .
'<C:calendar-data/>' .
'</D:prop>' .
'<C:filter>' .
'<C:comp-filter name="VCALENDAR">' .
'<C:comp-filter name="VTODO">' .
'<C:prop-filter name="UID">' .
'<C:text-match collation="i;octet">' . htmlspecialchars($uid, ENT_XML1, 'UTF-8') . '</C:text-match>' .
'</C:prop-filter>' .
'</C:comp-filter>' .
'</C:comp-filter>' .
'</C:filter>' .
'</C:calendar-query>';
$response = self::request('REPORT', $caldavUrl, $username, $password, $body, [
'Content-Type: application/xml; charset=utf-8',
'Depth: 1',
]);
return null;
}
if ($response === null) return null;
return self::parseReportResponse($response, $caldavUrl);
}
@@ -245,13 +222,10 @@ class CalDavClient
}
}
// Copy VEVENT and VTODO components
// Copy VEVENT components
foreach ($cal->select('VEVENT') as $component) {
$merged->add(clone $component);
}
foreach ($cal->select('VTODO') as $component) {
$merged->add(clone $component);
}
} catch (Throwable $e) {
// Skip malformed objects
continue;