Expose URI attachments as 'links' for event objects

This commit is contained in:
Thomas Bruederli 2013-02-27 17:05:10 +01:00
parent 032353e221
commit ef30be7dea

View file

@ -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