summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Kolab/CalDAV/CalendarBackend.php16
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);
}