Branch 'kolab-syncroton-2.1' - lib/ext
Aleksander Machniak
machniak at kolabsys.com
Fri Jun 28 13:58:20 CEST 2013
lib/ext/Syncroton/Command/Sync.php | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit e0e61a56b10497f44d9afb1ee83c6d8685de87d2
Author: Aleksander Machniak <alec at alec.pl>
Date: Fri Jun 28 13:57:39 2013 +0200
Unset all truncation settings for fetch response (fixes lack of attachments in iOS)
diff --git a/lib/ext/Syncroton/Command/Sync.php b/lib/ext/Syncroton/Command/Sync.php
index 3308bed..79a4f5b 100644
--- a/lib/ext/Syncroton/Command/Sync.php
+++ b/lib/ext/Syncroton/Command/Sync.php
@@ -681,6 +681,17 @@ class Syncroton_Command_Sync extends Syncroton_Command_Wbxml
// send response for to be fetched entries
if(!empty($collectionData->toBeFetched)) {
+ // unset all truncation settings as entries are not allowed to be truncated during fetch
+ $fetchCollectionData = clone $collectionData;
+
+ // unset truncationSize
+ if (isset($fetchCollectionData->options['bodyPreferences']) && is_array($fetchCollectionData->options['bodyPreferences'])) {
+ foreach($fetchCollectionData->options['bodyPreferences'] as $key => $bodyPreference) {
+ unset($fetchCollectionData->options['bodyPreferences'][$key]['truncationSize']);
+ }
+ }
+ $fetchCollectionData->options['mimeTruncation'] = Syncroton_Command_Sync::TRUNCATE_NOTHING;
+
foreach($collectionData->toBeFetched as $serverId) {
$fetch = $responses->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Fetch'));
$fetch->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ServerId', $serverId));
@@ -689,7 +700,7 @@ class Syncroton_Command_Sync extends Syncroton_Command_Wbxml
$applicationData = $this->_outputDom->createElementNS('uri:AirSync', 'ApplicationData');
$dataController
- ->getEntry($collectionData, $serverId)
+ ->getEntry($fetchCollectionData, $serverId)
->appendXML($applicationData, $this->_device);
$fetch->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'Status', self::STATUS_SUCCESS));
More information about the commits
mailing list