summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-03-10 12:02:45 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-03-10 12:02:45 (GMT)
commit2f7d5c6287f4e917c3facba9798989922349b5be (patch)
treea9ed74c00b792b98e4a04257be33d788ef8e8024
parente1d7b571ac8974739572b70e18ce87b5fac333e3 (diff)
downloadkolab-syncroton-2f7d5c6287f4e917c3facba9798989922349b5be.tar.gz
Fix for devices not supporting empty Sync responses (Bug #2664)
-rw-r--r--lib/ext/Syncroton/Command/Sync.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/ext/Syncroton/Command/Sync.php b/lib/ext/Syncroton/Command/Sync.php
index 40ff6df..89e4363 100644
--- a/lib/ext/Syncroton/Command/Sync.php
+++ b/lib/ext/Syncroton/Command/Sync.php
@@ -415,6 +415,9 @@ class Syncroton_Command_Sync extends Syncroton_Command_Wbxml
$collections = $this->_outputDom->createElementNS('uri:AirSync', 'Collections');
$totalChanges = 0;
+
+ // Detect devices that do not support empty Sync reponse
+ $emptySyncSupported = !preg_match('/(meego|nokian800)/i', $this->_device->useragent);
// continue only if there are changes or no time is left
if ($this->_heartbeatInterval > 0) {
@@ -888,7 +891,7 @@ class Syncroton_Command_Sync extends Syncroton_Command_Wbxml
if ($this->_logger instanceof Zend_Log)
$this->_logger->info(__METHOD__ . '::' . __LINE__ . " current synckey is ". $collectionData->syncState->counter);
- if ($collection->childNodes->length > 4 || $collectionData->syncState->counter != $collectionData->syncKey) {
+ if (!$emptySyncSupported || $collection->childNodes->length > 4 || $collectionData->syncState->counter != $collectionData->syncKey) {
$collections->appendChild($collection);
}
}