Commit a0773223 authored by Sebastian Kummer's avatar Sebastian Kummer

ZO-42 First prototype.

(cherry picked from commit 9f395cf9)
parent a635643c
......@@ -84,8 +84,9 @@ class ImportChangesStream implements IImportChanges {
*/
public function ImportMessageChange($id, $message) {
// ignore other SyncObjects
if(!($message instanceof $this->classAsString))
if(!($message instanceof $this->classAsString) && !($this->classAsString == "SyncNote" && Request::GetDeviceType() == "WindowsOutlook")) {
return false;
}
// prevent sending the same object twice in one request
if (in_array($id, $this->seenObjects)) {
......@@ -242,6 +243,12 @@ class ImportChangesStream implements IImportChanges {
else
$this->encoder->startTag(SYNC_FOLDERHIERARCHY_UPDATE);
// TODO this is part of synchronizing additional Contact folder to OL
if ($folder->type == SYNC_FOLDER_TYPE_USER_CONTACT && Request::GetDeviceType() == "WindowsOutlook") {
$folder->type = SYNC_FOLDER_TYPE_USER_APPOINTMENT;
}
$folder->Encode($this->encoder);
$this->encoder->endTag();
......
......@@ -446,9 +446,28 @@ class Sync extends RequestProcessor {
// Get the SyncMessage if sent
if(($el = self::$decoder->getElementStartTag(SYNC_DATA)) && ($el[EN_FLAGS] & EN_FLAGS_CONTENT)) {
$message = ZPush::getSyncObjectFromFolderClass($spa->GetContentClass());
ZLog::Write(LOGLEVEL_DEBUG, "--------------ContentClass:". $spa->GetContentClass(). " foldertype:".$foldertype);
$message = ZPush::getSyncObjectFromFolderClass(($foldertype)?$foldertype:$spa->GetContentClass());
// Acacia sends notes as Tasks
if ($spa->GetContentClass() == "Notes" && Request::GetDeviceType() == "WindowsOutlook") {
$message = new SyncTask();
}
$message->Decode(self::$decoder);
// Acacia: transform the SyncTask into a SyncNote
if ($spa->GetContentClass() == "Notes" && Request::GetDeviceType() == "WindowsOutlook") {
$note = new SyncNote();
if (isset($message->asbody))
$note->asbody = $message->asbody;
if (isset($message->categories))
$note->categories = $message->categories;
$note->subject = $message->subject;
// TODO color of the note
$message = $note;
}
// set Ghosted fields
$message->emptySupported(self::$deviceManager->GetSupportedFields($spa->GetFolderId()));
if(!self::$decoder->getElementEndTag()) // end applicationdata
......
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