* Calendar/eSync/CalDAV: meeting requests contain again nice body followed by a separator and describtion, ignore empty description in eSync ChangeMessage

This commit is contained in:
Ralf Becker 2012-07-24 22:23:32 +00:00
parent a6371947bb
commit eff584ff4b
2 changed files with 12 additions and 15 deletions

View File

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

View File

@ -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')
{