diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2013-07-24 16:25:10 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2013-07-24 16:25:10 (GMT) |
commit | ee67f6c3050480f7d4f4f0ba663b49bdb3d86de8 (patch) | |
tree | eb4d9492d265275307cf1fb953271ad18407e3c8 /lib | |
parent | 26f60d8b9ba3a4a67e12144cc4c620983bf21c72 (diff) | |
download | iRony-ee67f6c3050480f7d4f4f0ba663b49bdb3d86de8.tar.gz |
Fix attachment handling in CalDAV
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kolab/CalDAV/CalendarBackend.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Kolab/CalDAV/CalendarBackend.php b/lib/Kolab/CalDAV/CalendarBackend.php index 8aa7bf6..f9a6a3f 100644 --- a/lib/Kolab/CalDAV/CalendarBackend.php +++ b/lib/Kolab/CalDAV/CalendarBackend.php @@ -463,7 +463,7 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend } // process attachments - if (/* user agent known to handle attachments inline */ FALSE) { + if (/* user agent known to handle attachments inline */ !empty($object['attachments'])) { $object['_attachments'] = $object['attachments']; // mark all existing attachments as deleted (update is always absolute) @@ -642,16 +642,16 @@ class CalendarBackend extends CalDAV\Backend\AbstractBackend $ical = libcalendaring::get_ical(); $ical->set_prodid('-//Kolab//iRony DAV Server ' . KOLAB_DAV_VERSION . '//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN'); - // embed attachments for iCal - if ($this->useragent == 'ical') { + // list attachments as absolute URIs for Thunderbird + if ($this->useragent == 'lightning') { + $ical->set_attach_uri($base_uri . ':attachment:{{id}}:{{name}}'); + $get_attachment = null; + } + else { // embed attachments for others $get_attachment = function($id, $event) use ($storage) { - return $storage->get_attachment($event['id'], $id); + return $storage->get_attachment($event['uid'], $id); }; } - else { // list attachments as absolute URIs - $get_attachment = null; - $ical->set_attach_uri($base_uri . ':attachment:{{id}}:{{name}}'); - } return $ical->export(array($event), null, false, $get_attachment); } |