--- kronolith/lib/api.php.org	2008-10-28 23:36:35.000000000 +0100
+++ kronolith/lib/api.php	2008-10-29 09:59:18.000000000 +0100
@@ -850,15 +850,22 @@
  *                             text/x-vcalendar (old VCALENDAR 1.0 format.
  *                                              Still in wide use)
  *                            </pre>
+ * @param bool $defaultcalendar  Should we only use user's default calendar ?
  *
  * @return string  The requested data.
  */
-function _kronolith_export($uid, $contentType)
+function _kronolith_export($uid, $contentType, $defaultcalendar = false)
 {
     require_once dirname(__FILE__) . '/base.php';
     global $kronolith_driver, $kronolith_shares;
 
-    $event = $kronolith_driver->getByUID($uid);
+    if ($defaultcalendar == false) {
+        $event = $kronolith_driver->getByUID($uid);
+    } else {
+        $calendar[] = Kronolith::getDefaultCalendar(PERMS_EDIT);
+        $event = $kronolith_driver->getByUID($uid, $calendar);
+    }
+
     if (is_a($event, 'PEAR_Error')) {
         return $event;
     }
--- imp/lib/MIME/Viewer/itip.php.org	2008-10-29 09:59:58.000000000 +0100
+++ imp/lib/MIME/Viewer/itip.php	2008-10-29 09:46:10.000000000 +0100
@@ -135,7 +135,7 @@
                     $guid = $components[$key]->getAttribute('UID');
                     // Check if this is an update.
                     if ($registry->hasMethod('calendar/export') &&
-                        !is_a($registry->call('calendar/export', array($guid, 'text/calendar')), 'PEAR_Error')) {
+                        !is_a($registry->call('calendar/export', array('uid' => $guid, 'contentType' => 'text/calendar', 'defaultcalendar' => true)), 'PEAR_Error')) {
                         // Update in Kronolith.
                         if ($registry->hasMethod('calendar/replace')) {
                             $handled = true;