From ef30be7dea950459bb3c68839285b31ebae140a3 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 27 Feb 2013 17:05:10 +0100 Subject: [PATCH] Expose URI attachments as 'links' for event objects --- plugins/libkolab/lib/kolab_format_event.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php index 6b1db886..cd357fc5 100644 --- a/plugins/libkolab/lib/kolab_format_event.php +++ b/plugins/libkolab/lib/kolab_format_event.php @@ -86,6 +86,13 @@ class kolab_format_event extends kolab_format_xcal $attach->setUri('cid:' . $cid, $attr['mimetype']); $vattach->push($attach); } + + foreach ((array)$object['links'] as $link) { + $attach = new Attachment; + $attach->setUri($link, null); + $vattach->push($attach); + } + $this->obj->setAttachments($vattach); // cache this data @@ -154,6 +161,9 @@ class kolab_format_event extends kolab_format_xcal 'content' => $data, ); } + else if (substr($attach->uri(), 0, 4) == 'http') { + $object['links'][] = $attach->uri(); + } } // merge with additional data, e.g. attachments from the message