Branch 'kolab-syncroton-2.2' - lib/ext
Aleksander Machniak
machniak at kolabsys.com
Mon Mar 10 13:03:13 CET 2014
lib/ext/Syncroton/Command/Sync.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 2f7d5c6287f4e917c3facba9798989922349b5be
Author: Aleksander Machniak <machniak at kolabsys.com>
Date: Mon Mar 10 13:02:45 2014 +0100
Fix for devices not supporting empty Sync responses (Bug #2664)
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);
}
}
More information about the commits
mailing list