Skip to content

Commit

Permalink
Comments/@todo etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jan 9, 2015
1 parent 714f6ee commit 661e2e0
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions framework/Core/lib/Horde/Core/ActiveSync/Driver.php
Expand Up @@ -868,6 +868,7 @@ public function getServerChanges(
$parts = $this->_parseFolderId($folder->serverid());
$server_id = $parts[self::FOLDER_PART_ID];
}

if ($from_ts == 0 && !$ignoreFirstSync) {
// Can't use History if it's a first sync
$startstamp = (int)$cutoffdate;
Expand Down Expand Up @@ -895,17 +896,24 @@ public function getServerChanges(
return array();
}

// Softdelete. We check this once per close-to 24 hour period.
// We introduce an element of randomness in the time to help
// avoid a large number of clients performing a softdelete at
// once. It's 23 hours + some random number of minutes < 60.
// Softdelete. We check this once per close-to 24 hour period,or
// if the FILTERTYPE range changes. We introduce an element of
// randomness in the time to help avoid a large number of
// clients performing a softdelete at once. It's 23 hours + some
// random number of minutes < 60.
//
// @todo We need to populate additional events if the FILTERTYPE
// is expanded, but we need to persist the previous FILTERTYPE
// so we know exactly which events we already have and which
// we don't (since we don't track the UIDs themselves).
if (!$ping) {
if (!$refreshFilter) {
$sd = $folder->getSoftDeleteTimes();
if ($sd[1] + 82800 + mt_rand(0, 3600) < time()) {
$from = $sd[2];
}
} else {
// Force refresh the FILTERTYPE.
$from = 0;
}
if (isset($from)) {
Expand Down

0 comments on commit 661e2e0

Please sign in to comment.