Commit 2161641e authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-824 Invalidate all pingable flags on folders when doing a FolderSync

(with changes) or FolderChange (Create, Update, Delete) operation.

Released under the Affero GNU General Public License (AGPL) version 3. 
parent 109eb8f7
......@@ -72,6 +72,27 @@ class SyncCollections implements Iterator {
private $waitingTime = 0;
/**
* Invalidates all pingable flags for all folders.
*
* @access public
* @return boolean
*/
static public function InvalidatePingableFlags() {
ZLog::Write(LOGLEVEL_DEBUG, "SyncCollections::InvalidatePingableFlags(): Invalidating now");
try {
$sc = new SyncCollections();
$sc->LoadAllCollections();
foreach ($sc as $folderid => $spa) {
$spa->DelPingableFlag();
$sc->SaveCollection($spa);
}
return true;
}
catch (ZPushException $e) {}
return false;
}
/**
* Constructor
*/
......
......@@ -247,6 +247,9 @@ class FolderChange extends RequestProcessor {
// update SPA & save it
$spa->SetSyncKey($newsynckey);
self::$deviceManager->GetStateManager()->SetSynchedFolderState($spa);
// invalidate all pingable flags
$sc = SyncCollections::InvalidatePingableFlags();
}
return true;
......
......@@ -259,6 +259,9 @@ class FolderSync extends RequestProcessor {
// update SPA & save it
$spa->SetSyncKey($newsynckey);
self::$deviceManager->GetStateManager()->SetSynchedFolderState($spa);
// invalidate all pingable flags
$sc = SyncCollections::InvalidatePingableFlags();
}
}
}
......
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