Commit 9844b35d authored by Manfred Kutas's avatar Manfred Kutas

ZP-877 Honour changing sync period on the mobile.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 42a44808
...@@ -282,6 +282,9 @@ class Sync extends RequestProcessor { ...@@ -282,6 +282,9 @@ class Sync extends RequestProcessor {
// use default conflict handling if not specified by the mobile // use default conflict handling if not specified by the mobile
$spa->SetConflict(SYNC_CONFLICT_DEFAULT); $spa->SetConflict(SYNC_CONFLICT_DEFAULT);
// save the current filtertype because it might have been changed on the mobile
$currentFilterType = $spa->GetFilterType();
while(self::$decoder->getElementStartTag(SYNC_OPTIONS)) { while(self::$decoder->getElementStartTag(SYNC_OPTIONS)) {
$firstOption = true; $firstOption = true;
WBXMLDecoder::ResetInWhile("syncOptions"); WBXMLDecoder::ResetInWhile("syncOptions");
...@@ -294,6 +297,9 @@ class Sync extends RequestProcessor { ...@@ -294,6 +297,9 @@ class Sync extends RequestProcessor {
// switch the foldertype for the next options // switch the foldertype for the next options
$spa->UseCPO($foldertype); $spa->UseCPO($foldertype);
// save the current filtertype because it might have been changed on the mobile
$currentFilterType = $spa->GetFilterType();
// set to synchronize all changes. The mobile could overwrite this value // set to synchronize all changes. The mobile could overwrite this value
$spa->SetFilterType(SYNC_FILTERTYPE_ALL); $spa->SetFilterType(SYNC_FILTERTYPE_ALL);
...@@ -303,6 +309,8 @@ class Sync extends RequestProcessor { ...@@ -303,6 +309,8 @@ class Sync extends RequestProcessor {
// if no foldertype is defined, use default cpo // if no foldertype is defined, use default cpo
else if ($firstOption){ else if ($firstOption){
$spa->UseCPO(); $spa->UseCPO();
// save the current filtertype because it might have been changed on the mobile
$currentFilterType = $spa->GetFilterType();
// set to synchronize all changes. The mobile could overwrite this value // set to synchronize all changes. The mobile could overwrite this value
$spa->SetFilterType(SYNC_FILTERTYPE_ALL); $spa->SetFilterType(SYNC_FILTERTYPE_ALL);
} }
...@@ -388,6 +396,11 @@ class Sync extends RequestProcessor { ...@@ -388,6 +396,11 @@ class Sync extends RequestProcessor {
$spa->SetFilterType(SYNC_FILTERTIME_MAX); $spa->SetFilterType(SYNC_FILTERTIME_MAX);
} }
if ($currentFilterType != $spa->GetFilterType()) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync(): filter type has changed (old: '%s', new: '%s'), removing folderstat to force Exporter setup", $currentFilterType, $spa->GetFilterType()));
$spa->DelFolderStat();
}
// Check if the hierarchycache is available. If not, trigger a HierarchySync // Check if the hierarchycache is available. If not, trigger a HierarchySync
if (self::$deviceManager->IsHierarchySyncRequired()) { if (self::$deviceManager->IsHierarchySyncRequired()) {
$status = SYNC_STATUS_FOLDERHIERARCHYCHANGED; $status = SYNC_STATUS_FOLDERHIERARCHYCHANGED;
......
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