Commit 6da1df49 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-919 Show GAB folder with own class in z-push-top.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 25b1ee3b
...@@ -476,9 +476,12 @@ class SyncCollections implements Iterator { ...@@ -476,9 +476,12 @@ class SyncCollections implements Iterator {
if ($onlyPingable && $spa->GetPingableFlag() !== true || ! $folderid) if ($onlyPingable && $spa->GetPingableFlag() !== true || ! $folderid)
continue; continue;
if (!isset($classes[$spa->GetContentClass()])) // the class name will be overwritten for KOE-GAB
$classes[$spa->GetContentClass()] = 0; $class = $this->getPingClass($spa);
$classes[$spa->GetContentClass()] += 1;
if (!isset($classes[$class]))
$classes[$class] = 0;
$classes[$class] += 1;
} }
if (empty($classes)) if (empty($classes))
$checkClasses = "policies only"; $checkClasses = "policies only";
...@@ -808,6 +811,22 @@ class SyncCollections implements Iterator { ...@@ -808,6 +811,22 @@ class SyncCollections implements Iterator {
return ($this->waitingTime > 0); return ($this->waitingTime > 0);
} }
/**
* Returns how the current folder should be called in the PING comment.
*
* @param SyncParameters $spa
*
* @access public
* @return string
*/
private function getPingClass($spa) {
$class = $spa->GetContentClass();
if ($class == "Calendar" && strpos($spa->GetFolderId(), DeviceManager::FLD_ORIGIN_GAB) === 0) {
$class = "GAB";
}
return $class;
}
/** /**
* Simple Iterator Interface implementation to traverse through collections * Simple Iterator Interface implementation to traverse through collections
*/ */
......
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