diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2014-03-13 11:42:34 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2014-03-13 12:16:05 (GMT) |
commit | 7a1b9ef62b81d1e05c46b55a853e09cccd31b007 (patch) | |
tree | cf843c1b04a6e6de8cb57fb16b380b52509bb8ab /lib | |
parent | ab5eee6656ab6c31c5f2a2ab84f2cb1c65e2a8f4 (diff) | |
download | iRony-7a1b9ef62b81d1e05c46b55a853e09cccd31b007.tar.gz |
Comply with Sabre\CalDAV\Plugin and return free-busy data as parsed vobject + log errors in free-busy data retrieval
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kolab/CalDAV/Plugin.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Kolab/CalDAV/Plugin.php b/lib/Kolab/CalDAV/Plugin.php index c3b064f..11c4958 100644 --- a/lib/Kolab/CalDAV/Plugin.php +++ b/lib/Kolab/CalDAV/Plugin.php @@ -171,6 +171,8 @@ class Plugin extends CalDAV\Plugin */ protected function getFreeBusyForEmail($email, \DateTime $start, \DateTime $end, VObject\Component $request) { + console(__METHOD__, $email, $start, $end); + $email = preg_replace('/^mailto:/', '', $email); // pass-through the pre-generatd free/busy feed from Kolab's free/busy service @@ -197,15 +199,17 @@ class Plugin extends CalDAV\Plugin // success! if ($response->getStatus() == 200) { + $vcalendar = VObject\Reader::read($response->getBody(), VObject\Reader::OPTION_FORGIVING | VObject\Reader::OPTION_IGNORE_INVALID_LINES); return array( - 'calendar-data' => $response->getBody(), + 'calendar-data' => $vcalendar, 'request-status' => '2.0;Success', 'href' => 'mailto:' . $email, ); } } catch (\Exception $e) { - // ignore failures + // log failures + rcube::raise_error($e, true, false); } } else { |