Commit e6409f02 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-947 Send global status code if no output was generated yet in case of

a SYNC_STATUS_FOLDERHIERARCHYCHANGED. Additional log when opening folder
entry.

Released under the Affero GNU General Public License (AGPL) version 3.
parent e6e8da1f
...@@ -92,15 +92,19 @@ class ExportChangesICS implements IExportChanges{ ...@@ -92,15 +92,19 @@ class ExportChangesICS implements IExportChanges{
} }
$folder = false; $folder = false;
if ($entryid) if ($entryid) {
$folder = mapi_msgstore_openentry($this->store, $entryid); $folder = mapi_msgstore_openentry($this->store, $entryid);
ZLog::Write(LOGLEVEL_WARN, sprintf("ExportChangesICS(): Error, mapi_msgstore_openentry() failed: 0x%08X", mapi_last_hresult()));
}
// Get the actual ICS exporter // Get the actual ICS exporter
if($folderid) { if($folderid) {
if ($folder) if ($folder) {
$this->exporter = mapi_openproperty($folder, PR_CONTENTS_SYNCHRONIZER, IID_IExchangeExportChanges, 0 , 0); $this->exporter = mapi_openproperty($folder, PR_CONTENTS_SYNCHRONIZER, IID_IExchangeExportChanges, 0 , 0);
else }
else {
$this->exporter = false; $this->exporter = false;
}
} }
else { else {
$this->exporter = mapi_openproperty($folder, PR_HIERARCHY_SYNCHRONIZER, IID_IExchangeExportChanges, 0 , 0); $this->exporter = mapi_openproperty($folder, PR_HIERARCHY_SYNCHRONIZER, IID_IExchangeExportChanges, 0 , 0);
......
...@@ -886,6 +886,15 @@ class Sync extends RequestProcessor { ...@@ -886,6 +886,15 @@ class Sync extends RequestProcessor {
continue; continue;
} }
// if there are no other responses sent, we should add with a global status
if ($status == SYNC_STATUS_FOLDERHIERARCHYCHANGED && $this->startTagsSent === false) {
$this->sendStartTags();
self::$encoder->startTag(SYNC_STATUS);
self::$encoder->content($status);
self::$encoder->endTag();
return true;
}
// there is something to send here, sync folder to output // there is something to send here, sync folder to output
$this->syncFolder($sc, $spa, $exporter, $changecount, $streamimporter, $status, $newFolderStat); $this->syncFolder($sc, $spa, $exporter, $changecount, $streamimporter, $status, $newFolderStat);
......
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