[Pkg-owncloud-commits] [owncloud] 19/111: Pick any none 100 status code before defaulting to 100

David Prévot taffit at moszumanska.debian.org
Wed Nov 20 21:38:36 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 17e45e20021084f84d07d0c7590ebc2645b5d889
Author: Tom Needham <tom at tre.tomneedham.com>
Date:   Wed Nov 13 00:45:49 2013 +0000

    Pick any none 100 status code before defaulting to 100
---
 lib/private/api.php |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/lib/private/api.php b/lib/private/api.php
index eac4a82..8307f20 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -170,7 +170,7 @@ class OC_API {
 			$response = reset($thirdparty['failed']);
 			return $response;
 		} else {
-			$responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
+			$responses = $thirdparty['succeeded'];
 		}
 		// Merge the successful responses
 		$meta = array();
@@ -182,8 +182,19 @@ class OC_API {
 			} else {
 				$data = array_merge_recursive($data, $response->getData());
 			}
+			$codes[] = $response->getStatusCode();
+		}
+
+		// Use any non 100 status codes
+		$statusCode = 100;
+		foreach($codes as $code) {
+			if($code != 100) {
+				$statusCode = $code;
+				break;
+			}
 		}
-		$result = new OC_OCS_Result($data, 100);
+
+		$result = new OC_OCS_Result($data, $statusCode);
 		return $result;
 	}
 	

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list