Commit 52f34812 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #401 in ZP/z-push from...

Merge pull request #401 in ZP/z-push from feature/ZP-968-retest-ics-exports-delete-for-all to develop

* commit '4994dd57':
  ZP-968 Execute check on state usage only on ZCP versions before 7.2.3. Nothing changes for systems without ZCP/KC as the check is executed as before.
  ZP-968 Revert "ZP-968 Partially undo changes of commit aeab7567. This prevents access to the volatile state to check if the state was already used."
  ZP-968 Use 0x80000 flag when setting up exporter in Ping.
  ZP-968 Partially undo changes of commit aeab7567. This prevents access to the volatile state to check if the state was already used.
parents d0a4abf7 4994dd57
......@@ -134,8 +134,10 @@ class ExportChangesICS implements IExportChanges{
}
}
if($this->flags & BACKEND_DISCARD_DATA)
if($this->flags & BACKEND_DISCARD_DATA) {
$this->exporterflags |= SYNC_CATCHUP;
$this->exporterflags |= SYNC_STATE_READONLY;
}
// Put the state information in a stream that can be used by ICS
$stream = mapi_stream_create();
......@@ -305,6 +307,11 @@ class ExportChangesICS implements IExportChanges{
* @return array
*/
public function Synchronize() {
if ($this->flags & BACKEND_DISCARD_DATA) {
ZLog::Write(LOGLEVEL_WARN, 'ExportChangesICS->Synchronize(): not supported in combination with the BACKEND_DISCARD_DATA flag.');
return false;
}
if ($this->exporter) {
return mapi_exportchanges_synchronize($this->exporter);
}
......
......@@ -596,6 +596,7 @@ define('SYNC_PROGRESS_MODE' ,0x8000); // AirMapi pro
define('SYNC_FXRECOVERMODE' ,0x10000);
define('SYNC_DEFER_CONFIG' ,0x20000);
define('SYNC_FORCE_UNICODE' ,0x40000); // Forces server to return Unicode properties
define('SYNC_STATE_READONLY' ,0x80000); // Server will not update the states in the DB, setting up exporter with this flag states are read only
define('EMS_AB_ADDRESS_LOOKUP' ,0x00000001); // Flag for resolvename to resolve only exact matches
......
......@@ -665,12 +665,15 @@ class SyncCollections implements Iterator {
return false;
}
// prevent ZP-623 by checking if the states have been used before, if so force a sync on this folder
// Prevent ZP-623 by checking if the states have been used before, if so force a sync on this folder.
// ZCP/KC 7.2.3 and newer support SYNC_STATE_READONLY so this behaviour is not required (see ZP-968).
if (!Utils::CheckMapiExtVersion('7.2.3')) {
if (ZPush::GetDeviceManager()->CheckHearbeatStateIntegrity($spa->GetFolderId(), $spa->GetUuid(), $spa->GetUuidCounter())) {
ZLog::Write(LOGLEVEL_DEBUG, "SyncCollections->CountChange(): Cannot verify changes for state as it was already used. Forcing sync of folder.");
$this->changes[$folderid] = 1;
return true;
}
}
$backendFolderId = ZPush::GetDeviceManager()->GetBackendIdForFolderId($folderid);
// switch user store if this is a additional folder (additional true -> do not debug)
......
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