Page MenuHomePhorge

D4695.1775495674.diff
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

D4695.1775495674.diff

diff --git a/lib/ext/Syncroton/Command/Sync.php b/lib/ext/Syncroton/Command/Sync.php
--- a/lib/ext/Syncroton/Command/Sync.php
+++ b/lib/ext/Syncroton/Command/Sync.php
@@ -911,6 +911,8 @@
$applicationData = $change->appendChild($this->_outputDom->createElementNS('uri:AirSync', 'ApplicationData'));
+ $collectionData->options['_changesOnly'] = true;
+
$dataController
->getEntry($collectionData, $serverId)
->appendXML($applicationData, $this->_device);
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -255,6 +255,15 @@
$truncateAt = null;
$opts = $collection->options;
$prefs = $opts['bodyPreferences'];
+ $changesOnly = $opts['_changesOnly'];
+
+ if ($changesOnly) {
+ //The body never changes, so make sure we don't re-send it to the client on a change
+ $prefs = [];
+ rcube::console("Retrieving changesOnly");
+ $result['categories'] = $message->headers->others['categories'] ?? [];
+ return new Syncroton_Model_Email($result);
+ }
if ($opts['mimeSupport'] == Syncroton_Command_Sync::MIMESUPPORT_SEND_MIME) {
$airSyncBaseType = Syncroton_Command_Sync::BODY_TYPE_MIME;
diff --git a/tests/Sync/Sync/EmailTest.php b/tests/Sync/Sync/EmailTest.php
--- a/tests/Sync/Sync/EmailTest.php
+++ b/tests/Sync/Sync/EmailTest.php
@@ -153,6 +153,7 @@
$root .= "/ns:Commands/ns:Add";
$this->assertStringMatchesFormat("{$folderId}::%d", $xpath->query("{$root}/ns:ServerId")->item(0)->nodeValue);
$this->assertSame('sync test with attachment', $xpath->query("{$root}/ns:ApplicationData/Email:Subject")->item(0)->nodeValue);
+ $this->assertSame(1, $xpath->query("{$root}/ns:ApplicationData/AirSyncBase:Body")->count());
return $syncKey;
}
@@ -245,7 +246,11 @@
$this->assertSame($folderId, $xpath->query("{$root}/ns:CollectionId")->item(0)->nodeValue);
$this->assertSame(0, $xpath->query("{$root}/ns:Commands/ns:Add")->count());
$this->assertSame(2, $xpath->query("{$root}/ns:Commands/ns:Change")->count());
+ $this->assertSame(2, $xpath->query("{$root}/ns:Commands/ns:Change/ns:ApplicationData/Email:Read")->count());
+ $this->assertSame('0', $xpath->query("{$root}/ns:Commands/ns:Change/ns:ApplicationData/Email:Read")->item(0)->nodeValue);
+ $this->assertSame('0', $xpath->query("{$root}/ns:Commands/ns:Change/ns:ApplicationData/Email:Read")->item(1)->nodeValue);
+ $this->assertSame(0, $xpath->query("{$root}/ns:Commands/ns:Change/ns:ApplicationData/AirSyncBase:Body")->count());
return $syncKey;
}
diff --git a/tests/SyncTestCase.php b/tests/SyncTestCase.php
--- a/tests/SyncTestCase.php
+++ b/tests/SyncTestCase.php
@@ -379,6 +379,7 @@
$xpath = new \DOMXpath($dom);
$xpath->registerNamespace("ns", $dom->documentElement->namespaceURI);
$xpath->registerNamespace("AirSync", "uri:AirSync");
+ $xpath->registerNamespace("AirSyncBase", "uri:AirSyncBase");
$xpath->registerNamespace("Calendar", "uri:Calendar");
$xpath->registerNamespace("Contacts", "uri:Contacts");
$xpath->registerNamespace("Email", "uri:Email");

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 5:14 PM (14 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18838491
Default Alt Text
D4695.1775495674.diff (3 KB)

Event Timeline