Commit 8e811dba authored by skummer's avatar skummer

ZP-529 #comment allow random tag order for ItemOperations Fetch, simplyfied...

ZP-529 #comment allow random tag order for ItemOperations Fetch, simplyfied checking for empty options tag

git-svn-id: https://z-push.org/svn/z-push/trunk@1884 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 6dc871e3
......@@ -90,12 +90,14 @@ class ItemOperations extends RequestProcessor {
return false;
}
// process operation
while(1) {
if ($fetch) {
if(!self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_STORE))
return false;
if(self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_STORE)) {
$operation['store'] = self::$decoder->getElementContent();
if(!self::$decoder->getElementEndTag())
return false;//SYNC_ITEMOPERATIONS_STORE
}
if(self::$decoder->getElementStartTag(SYNC_SEARCH_LONGID)) {
$operation['longid'] = self::$decoder->getElementContent();
......@@ -121,7 +123,7 @@ class ItemOperations extends RequestProcessor {
return false;//SYNC_AIRSYNCBASE_FILEREFERENCE
}
if(self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_OPTIONS)) {
if(($el = self::$decoder->getElementStartTag(SYNC_ITEMOPERATIONS_OPTIONS)) && ($el[EN_FLAGS] & EN_FLAGS_CONTENT)) {
//TODO other options
//schema
//range
......@@ -133,12 +135,6 @@ class ItemOperations extends RequestProcessor {
// Save all OPTIONS into a ContentParameters object
$operation["cpo"] = new ContentParameters();
while(1) {
// Android 4.3 sends empty options tag, so we don't have to look further
$e = self::$decoder->peek();
if($e[EN_TYPE] == EN_TYPE_ENDTAG) {
break;
}
while (self::$decoder->getElementStartTag(SYNC_AIRSYNCBASE_BODYPREFERENCE)) {
if(self::$decoder->getElementStartTag(SYNC_AIRSYNCBASE_TYPE)) {
$bptype = self::$decoder->getElementContent();
......@@ -203,7 +199,7 @@ class ItemOperations extends RequestProcessor {
}
}
}
}
} // end if fetch
if ($efc) {
if(self::$decoder->getElementStartTag(SYNC_FOLDERID)) {
......@@ -226,8 +222,13 @@ class ItemOperations extends RequestProcessor {
//TODO move
if(!self::$decoder->getElementEndTag())
return false; //SYNC_ITEMOPERATIONS_FETCH or SYNC_ITEMOPERATIONS_EMPTYFOLDERCONTENTS or SYNC_ITEMOPERATIONS_MOVE
//break if it reached the endtag SYNC_ITEMOPERATIONS_FETCH or SYNC_ITEMOPERATIONS_EMPTYFOLDERCONTENTS or SYNC_ITEMOPERATIONS_MOVE
$e = self::$decoder->peek();
if($e[EN_TYPE] == EN_TYPE_ENDTAG) {
self::$decoder->getElementEndTag();
break;
}
} // end while operation
$itemoperations[] = $operation;
//break if it reached the endtag
......@@ -236,11 +237,7 @@ class ItemOperations extends RequestProcessor {
self::$decoder->getElementEndTag(); //SYNC_ITEMOPERATIONS_ITEMOPERATIONS
break;
}
}
// if(!self::$decoder->getElementEndTag())
// return false;//SYNC_ITEMOPERATIONS_ITEMOPERATIONS
} // end operations loop
$status = SYNC_ITEMOPERATIONSSTATUS_SUCCESS;
......
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