Commit 958db4e5 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #559 in ZP/z-push from develop to release/2.3

* commit '603250a2':
  ZP-1249 Answer with SYNC_STATUS_SYNCREQUESTINCOMPLETE if an empty sync request results in an empty response.
  ZP-1238 Save Atendee->type in MAPI.
  ZP-1248 Added WindowsMail to SYNC_TIMEOUT_LONG_DEVICETYPES.
  ZP-ZP-1247 Check for if a synckey was confirmed in the request.
parents 2778537d 603250a2
...@@ -1430,7 +1430,7 @@ class MAPIProvider { ...@@ -1430,7 +1430,7 @@ class MAPIProvider {
$org[PR_EMAIL_ADDRESS] = isset($representingprops[$appointmentprops["sentrepresentingemail"]]) ? $representingprops[$appointmentprops["sentrepresentingemail"]] : $props[$appointmentprops["sentrepresentingemail"]]; $org[PR_EMAIL_ADDRESS] = isset($representingprops[$appointmentprops["sentrepresentingemail"]]) ? $representingprops[$appointmentprops["sentrepresentingemail"]] : $props[$appointmentprops["sentrepresentingemail"]];
$org[PR_SEARCH_KEY] = isset($representingprops[$appointmentprops["sentrepresentinsrchk"]]) ? $representingprops[$appointmentprops["sentrepresentinsrchk"]] : $props[$appointmentprops["sentrepresentinsrchk"]]; $org[PR_SEARCH_KEY] = isset($representingprops[$appointmentprops["sentrepresentinsrchk"]]) ? $representingprops[$appointmentprops["sentrepresentinsrchk"]] : $props[$appointmentprops["sentrepresentinsrchk"]];
$org[PR_RECIPIENT_FLAGS] = recipOrganizer | recipSendable; $org[PR_RECIPIENT_FLAGS] = recipOrganizer | recipSendable;
$org[PR_RECIPIENT_TYPE] = MAPI_TO; $org[PR_RECIPIENT_TYPE] = MAPI_TO; // TODO: shouldn't that be MAPI_ORIG ?
array_push($recips, $org); array_push($recips, $org);
...@@ -1449,14 +1449,14 @@ class MAPIProvider { ...@@ -1449,14 +1449,14 @@ class MAPIProvider {
$recip[PR_SEARCH_KEY] = $userinfo[0][PR_SEARCH_KEY]; $recip[PR_SEARCH_KEY] = $userinfo[0][PR_SEARCH_KEY];
$recip[PR_ADDRTYPE] = $userinfo[0][PR_ADDRTYPE]; $recip[PR_ADDRTYPE] = $userinfo[0][PR_ADDRTYPE];
$recip[PR_ENTRYID] = $userinfo[0][PR_ENTRYID]; $recip[PR_ENTRYID] = $userinfo[0][PR_ENTRYID];
$recip[PR_RECIPIENT_TYPE] = MAPI_TO; $recip[PR_RECIPIENT_TYPE] = isset($attendee->attendeetype) ? $attendee->attendeetype : MAPI_TO;
$recip[PR_RECIPIENT_FLAGS] = recipSendable; $recip[PR_RECIPIENT_FLAGS] = recipSendable;
} }
else { else {
$recip[PR_DISPLAY_NAME] = u2w($attendee->name); $recip[PR_DISPLAY_NAME] = u2w($attendee->name);
$recip[PR_SEARCH_KEY] = "SMTP:".$recip[PR_EMAIL_ADDRESS]."\0"; $recip[PR_SEARCH_KEY] = "SMTP:".$recip[PR_EMAIL_ADDRESS]."\0";
$recip[PR_ADDRTYPE] = "SMTP"; $recip[PR_ADDRTYPE] = "SMTP";
$recip[PR_RECIPIENT_TYPE] = MAPI_TO; $recip[PR_RECIPIENT_TYPE] = isset($attendee->attendeetype) ? $attendee->attendeetype : MAPI_TO;
$recip[PR_ENTRYID] = mapi_createoneoff($recip[PR_DISPLAY_NAME], $recip[PR_ADDRTYPE], $recip[PR_EMAIL_ADDRESS]); $recip[PR_ENTRYID] = mapi_createoneoff($recip[PR_DISPLAY_NAME], $recip[PR_ADDRTYPE], $recip[PR_EMAIL_ADDRESS]);
} }
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
// point. You can add DeviceType strings to the categories. // point. You can add DeviceType strings to the categories.
// In general longer timeouts are better, because more data can be streamed at once. // In general longer timeouts are better, because more data can be streamed at once.
define('SYNC_TIMEOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI"); define('SYNC_TIMEOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI");
define('SYNC_TIMEOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook"); define('SYNC_TIMEOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook, WindowsMail");
// Time in seconds the device should wait whenever the service is unavailable, // Time in seconds the device should wait whenever the service is unavailable,
// e.g. when a backend service is unavailable. // e.g. when a backend service is unavailable.
......
...@@ -286,6 +286,17 @@ class SyncParameters extends StateObject { ...@@ -286,6 +286,17 @@ class SyncParameters extends StateObject {
$this->checkCPO($this->currentCPO); $this->checkCPO($this->currentCPO);
} }
/**
* Indicates if the confirmation status changed for the SyncKey.
*
* @access public
* @return boolean
*/
public function HasConfirmationChanged() {
return $this->confirmationChanged;
}
/** /**
* Indicates if a exporter run is required. This is the case if the given folderstat is different from the saved one * Indicates if a exporter run is required. This is the case if the given folderstat is different from the saved one
* or when the expiration time expired. * or when the expiration time expired.
......
...@@ -887,7 +887,7 @@ class Sync extends RequestProcessor { ...@@ -887,7 +887,7 @@ class Sync extends RequestProcessor {
// Fir AS 14.0+ omit output for folder, if there were no incoming or outgoing changes and no Fetch // Fir AS 14.0+ omit output for folder, if there were no incoming or outgoing changes and no Fetch
if (Request::GetProtocolVersion() >= 14.0 && ! $spa->HasNewSyncKey() && $changecount == 0 && empty($actiondata["fetchids"]) && $status == SYNC_STATUS_SUCCESS && if (Request::GetProtocolVersion() >= 14.0 && ! $spa->HasNewSyncKey() && $changecount == 0 && empty($actiondata["fetchids"]) && $status == SYNC_STATUS_SUCCESS &&
($newFolderStat === false || ! $spa->IsExporterRunRequired($newFolderStat))) { ! $spa->HasConfirmationChanged() && ($newFolderStat === false || ! $spa->IsExporterRunRequired($newFolderStat))) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync: No changes found for %s folder id '%s'. Omitting output.", $spa->GetContentClass(), $spa->GetFolderId())); ZLog::Write(LOGLEVEL_DEBUG, sprintf("HandleSync: No changes found for %s folder id '%s'. Omitting output.", $spa->GetContentClass(), $spa->GetFolderId()));
continue; continue;
} }
...@@ -913,6 +913,14 @@ class Sync extends RequestProcessor { ...@@ -913,6 +913,14 @@ class Sync extends RequestProcessor {
if ($this->startFolderTagSent) if ($this->startFolderTagSent)
self::$encoder->endTag(); self::$encoder->endTag();
// Check if there was any response - in case of an empty sync request, we shouldn't send an empty answer (ZP-1241)
if (!$this->startTagsSent && $emptysync === true) {
$this->sendStartTags();
self::$encoder->startTag(SYNC_STATUS);
self::$encoder->content(SYNC_STATUS_SYNCREQUESTINCOMPLETE);
self::$encoder->endTag();
}
//SYNC_SYNCHRONIZE - only if the starttag was sent //SYNC_SYNCHRONIZE - only if the starttag was sent
if ($this->startTagsSent) if ($this->startTagsSent)
self::$encoder->endTag(); self::$encoder->endTag();
...@@ -1208,12 +1216,14 @@ class Sync extends RequestProcessor { ...@@ -1208,12 +1216,14 @@ class Sync extends RequestProcessor {
self::$deviceManager->SetFolderSyncStatus($spa->GetFolderId(), DeviceManager::FLD_SYNC_COMPLETED); self::$deviceManager->SetFolderSyncStatus($spa->GetFolderId(), DeviceManager::FLD_SYNC_COMPLETED);
// we should update the folderstat, but we recheck to see if it changed. If so, it's not updated to force another sync // we should update the folderstat, but we recheck to see if it changed. If so, it's not updated to force another sync
$newFolderStatAfterExport = self::$backend->GetFolderStat(ZPush::GetAdditionalSyncFolderStore($spa->GetBackendFolderId()), $spa->GetBackendFolderId()); if (self::$backend->HasFolderStats()) {
if ($newFolderStat === $newFolderStatAfterExport) { $newFolderStatAfterExport = self::$backend->GetFolderStat(ZPush::GetAdditionalSyncFolderStore($spa->GetBackendFolderId()), $spa->GetBackendFolderId());
$this->setFolderStat($spa, $newFolderStat); if ($newFolderStat === $newFolderStatAfterExport) {
} $this->setFolderStat($spa, $newFolderStat);
else { }
ZLog::Write(LOGLEVEL_DEBUG, "Sync() Folderstat differs after export, force another exporter run."); else {
ZLog::Write(LOGLEVEL_DEBUG, "Sync() Folderstat differs after export, force another exporter run.");
}
} }
} }
else else
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
class SyncAttendee extends SyncObject { class SyncAttendee extends SyncObject {
public $email; public $email;
public $name; public $name;
public $attendeestatus;
public $attendeetype;
function __construct() { function __construct() {
$mapping = array( $mapping = array(
......
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