Commit 36ca9f60 authored by mku's avatar mku

ZP-302 #comment Remove phone number from a contact on a mobile is not...

ZP-302 #comment   Remove phone number from a contact on a mobile is not reflected to the server   #time 5h

git-svn-id: https://z-push.org/svn/z-push/trunk@1605 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent a8b7d29f
......@@ -157,6 +157,19 @@
// default: 100 - value used if mobile does not limit amount of items
define('SYNC_MAX_ITEMS', 100);
// The devices usually send a list of supported properties for calendar and contact
// items. If a device does not includes such a supported property in Sync request,
// it means the property's value will be deleted on the server.
// However some devices do not send a list of supported properties. It is then impossible
// to tell if a property was deleted or it was not set at all if it does not appear in Sync.
// This parameter defines Z-Push behaviour during Sync if a device does not issue a list with
// supported properties.
// See also https://jira.zarafa.com/browse/ZP-302.
// Possible values:
// false - do not unset properties which are not sent during Sync (default)
// true - unset properties which are not sent during Sync
define('UNSET_UNDEFINED_PROPERTIES', false);
/**********************************************************************************
* Backend settings
*/
......
......@@ -80,8 +80,16 @@ abstract class SyncObject extends Streamer {
* @return boolean
*/
public function emptySupported($supportedFields) {
if ($supportedFields === false || !is_array($supportedFields))
return false;
// Some devices do not send supported tag. In such a case remove all not set properties.
if (($supportedFields === false || !is_array($supportedFields) || (empty($supportedFields)))) {
if (defined('UNSET_UNDEFINED_PROPERTIES') && UNSET_UNDEFINED_PROPERTIES && ($this instanceOf SyncContact || $this instanceOf SyncAppointment)) {
ZLog::Write(LOGLEVEL_INFO, sprintf("%s->emptySupported(): no supported list available, emptying all not set parameters", get_class($this)));
$supportedFields = array_keys($this->mapping);
}
else {
return false;
}
}
foreach ($supportedFields as $field) {
if (!isset($this->mapping[$field])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment