From 0b924e9e6eaef5eea85c382b23b838bb03d9a4ff Mon Sep 17 00:00:00 2001 From: Philip Herbert Date: Sun, 23 Oct 2011 18:16:41 +0000 Subject: [PATCH] esync: fix for not updated calender, contact, task on device if only description or note was changed in EGroupware. Also fixing issue that values in these fields could not be deleted on several devices. --- addressbook/inc/class.addressbook_activesync.inc.php | 12 ++++++++---- calendar/inc/class.calendar_activesync.inc.php | 12 ++++++++---- infolog/inc/class.infolog_activesync.inc.php | 12 ++++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/addressbook/inc/class.addressbook_activesync.inc.php b/addressbook/inc/class.addressbook_activesync.inc.php index 47dc8d84b8..b48fd1c7bd 100644 --- a/addressbook/inc/class.addressbook_activesync.inc.php +++ b/addressbook/inc/class.addressbook_activesync.inc.php @@ -350,11 +350,15 @@ class addressbook_activesync implements activesync_plugin_write, activesync_plug } else { - debugLog("airsyncbasebody!"); - $message->airsyncbasebody = new SyncAirSyncBaseBody(); - $message->airsyncbasenativebodytype=1; - $this->backend->note2messagenote($contact[$attr], $bodypreference, $message->airsyncbasebody); + if (strlen ($contact[$attr]) > 0) + { + debugLog("airsyncbasebody!"); + $message->airsyncbasebody = new SyncAirSyncBaseBody(); + $message->airsyncbasenativebodytype=1; + $this->backend->note2messagenote($contact[$attr], $bodypreference, $message->airsyncbasebody); + } } + $message->md5body = md5($contact[$attr]); break; case 'jpegphoto': diff --git a/calendar/inc/class.calendar_activesync.inc.php b/calendar/inc/class.calendar_activesync.inc.php index 32715eded1..e30dc770e9 100644 --- a/calendar/inc/class.calendar_activesync.inc.php +++ b/calendar/inc/class.calendar_activesync.inc.php @@ -1008,11 +1008,15 @@ return array(); // temporary disabling meeting requests from calendar } else { - debugLog("airsyncbasebody!"); - $message->airsyncbasebody = new SyncAirSyncBaseBody(); - $message->airsyncbasenativebodytype=1; - $this->backend->note2messagenote($event['description'], $bodypreference, $message->airsyncbasebody); + if (strlen($event['description']) > 0) + { + debugLog("airsyncbasebody!"); + $message->airsyncbasebody = new SyncAirSyncBaseBody(); + $message->airsyncbasenativebodytype=1; + $this->backend->note2messagenote($event['description'], $bodypreference, $message->airsyncbasebody); + } } + $message->md5body = md5($event['description']); $message->organizername = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_fullname'); $message->organizeremail = $GLOBALS['egw']->accounts->id2name($event['owner'],'account_email'); diff --git a/infolog/inc/class.infolog_activesync.inc.php b/infolog/inc/class.infolog_activesync.inc.php index ccdff24e17..d7094598da 100644 --- a/infolog/inc/class.infolog_activesync.inc.php +++ b/infolog/inc/class.infolog_activesync.inc.php @@ -248,11 +248,15 @@ class infolog_activesync implements activesync_plugin_write } else { - debugLog("airsyncbasebody!"); - $message->airsyncbasebody = new SyncAirSyncBaseBody(); - $message->airsyncbasenativebodytype=1; - $this->backend->note2messagenote($infolog[$attr], $bodypreference, $message->airsyncbasebody); + if (strlen ($infolog[$attr]) > 0) + { + debugLog("airsyncbasebody!"); + $message->airsyncbasebody = new SyncAirSyncBaseBody(); + $message->airsyncbasenativebodytype=1; + $this->backend->note2messagenote($infolog[$attr], $bodypreference, $message->airsyncbasebody); + } } + $message->md5body = md5($infolog[$attr]); break; case 'info_cat':