fix docu and logging as logic for change is in backend

This commit is contained in:
Ralf Becker 2016-02-23 15:04:30 +00:00
parent 1da38599b2
commit 4121546e85
2 changed files with 5 additions and 16 deletions

View File

@ -2070,7 +2070,7 @@ class calendar_bo
$users = $this->resolve_users($user);
$ctag = $users ? $this->so->get_ctag($users, $filter == 'owner', $master_only) : 0; // no rights, return 0 as ctag (otherwise we get SQL error!)
if ($this->debug > 1) error_log(__METHOD__. "($user, '$filter') = $ctag = ".date('Y-m-d H:i:s',$ctag)." took ".(microtime(true)-$startime)." secs");
if ($this->debug > 1) error_log(__METHOD__. "($user, '$filter', $master_only) = $ctag = ".date('Y-m-d H:i:s',$ctag)." took ".(microtime(true)-$startime)." secs");
return $ctag;
}

View File

@ -1297,33 +1297,22 @@ class calendar_zpush implements activesync_plugin_write, activesync_plugin_meeti
* if changes occurr default diff engine computes the actual changes
*
* @param string $folderid
* @param string &$syncstate on call old syncstate, on return new syncstate
* @return array|boolean false if $folderid not found, array() if no changes or array(array("type" => "fakeChange"))
* @param string &$syncstate on return new syncstate
*/
function AlterPingChanges($folderid, &$syncstate)
{
$type = $owner = null;
$this->backend->splitID($folderid, $type, $owner);
ZLog::Write(LOGLEVEL_DEBUG, __METHOD__."('$folderid','$syncstate') type='$type', owner=$owner");
if ($type != 'calendar') return false;
if (!isset($this->calendar)) $this->calendar = new calendar_boupdate();
//$ctag = $this->calendar->get_ctag($owner,'owner',true); // true only consider recurrence master
$ctag = $this->calendar->get_ctag($owner,false,true); // we only want to fetch the owners events, where he is a participant too
$syncstate = $this->calendar->get_ctag($owner,false,true); // we only want to fetch the owners events, where he is a participant too
// workaround for syncstate = 0 when calendar is empty causes synctate to not return 0 but array resulting in foldersync loop
if ($ctag == 0) $ctag = 1;
$changes = array(); // no change
$syncstate_was = $syncstate;
if ($syncstate == 0) $syncstate = 1;
if ($ctag !== $syncstate)
{
$syncstate = $ctag;
$changes = array(array('type' => 'fakeChange'));
}
//error_log(__METHOD__."('$folderid','$syncstate_was') syncstate='$syncstate' returning ".array2string($changes));
ZLog::Write(LOGLEVEL_DEBUG, __METHOD__."('$folderid','$syncstate_was') syncstate='$syncstate' returning ".array2string($changes));
return $changes;
ZLog::Write(LOGLEVEL_DEBUG, __METHOD__."('$folderid', ...) type='$type', owner=$owner --> syncstate='$syncstate'");
}
/**