From a15fc1457b78919c63f6f4b693d629b79f8ed9f0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 24 Jul 2012 22:23:54 +0000 Subject: [PATCH] * Calendar/eSync/CalDAV: meeting requests contain again nice body followed by a separator and describtion, ignore empty description in eSync ChangeMessage --- .../inc/class.calendar_activesync.inc.php | 8 ++++++-- calendar/inc/class.calendar_boupdate.inc.php | 19 ++++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/calendar/inc/class.calendar_activesync.inc.php b/calendar/inc/class.calendar_activesync.inc.php index 4b399707cb..a30d351977 100644 --- a/calendar/inc/class.calendar_activesync.inc.php +++ b/calendar/inc/class.calendar_activesync.inc.php @@ -635,8 +635,12 @@ return array(); // temporary disabling meeting requests from calendar if (isset($message->$attr)) $event[$key] = $message->$attr; } - $event['description'] = $this->backend->messagenote2note($message->body, $message->rtf, $message->airsyncbasebody); - + // only change description, if one given, as iOS5 skips description in ChangeMessage after MeetingResponse + // --> we ignore empty / not set description, so description get no longer lost, but you cant empty it via eSync + if (($description = $this->backend->messagenote2note($message->body, $message->rtf, $message->airsyncbasebody))) + { + $event['description'] = $description; + } $event['public'] = (int)($message->sensitivity < 1); // 0=normal, 1=personal, 2=private, 3=confidential // busystatus=(0=free|1=tentative|2=busy|3=out-of-office), EGw has non_blocking=0|1 diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index 5bb88f264e..e532b7312b 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -865,22 +865,20 @@ class calendar_boupdate extends calendar_bo 'encoding' => '8bit', 'type' => 'text/calendar; method='.$method, ); - $popup = $body; - $popupsubject = $subject; - // format iCal uses now like Exchange event-title as subject and description as body $subject = $event['title']; - $body = $event['description']; // fall through case 'extended': - $popup .= "\n\n".lang('Event Details follow').":\n"; + $body .= "\n\n".lang('Event Details follow').":\n"; foreach($event_arr as $key => $val) { if(!empty($details[$key])) { - switch($key){ + switch($key) + { case 'access': case 'priority': case 'link': + case 'description': break; default: $popup .= sprintf("%-20s %s\n",$val['field'].':',$details[$key]); @@ -888,11 +886,8 @@ class calendar_boupdate extends calendar_bo } } } - if ($part_prefs['calendar']['update_format']=='extended') - { - $body = $body.$popup; - unset($popup); - } + // description need to be separated from body by fancy separator + $body .= "\n*~*~*~*~*~*~*~*~*~*\n\n".$details['description']; break; } // send via notification_app @@ -903,10 +898,8 @@ class calendar_boupdate extends calendar_bo $notification = new notifications(); $notification->set_receivers(array($userid)); $notification->set_message($body); - if (isset($popup)&&!empty($popup)) $notification->set_popupmessage($popup); $notification->set_sender($senderid); $notification->set_subject($subject); - if (isset($popupsubject)&&!empty($popupsubject)) $notification->set_popupsubject($popupsubject); // as we want ical body to be just describtion, we can NOT set links, as they get appended to body if ($part_prefs['calendar']['update_format'] != 'ical') {