Felamimail - ActiveSync - added default sort order 'received' desc to search
authorPaul Mehrer <p.mehrer@metaways.de>
Tue, 5 Jan 2016 14:28:42 +0000 (15:28 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 6 Jan 2016 13:50:55 +0000 (14:50 +0100)
Change-Id: I89f1e67393600f6855e6ed800665c54e8128edd4
Reviewed-on: http://gerrit.tine20.com/customers/2548
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Felamimail/Frontend/ActiveSync.php

index 5d0c888..dc9bd11 100644 (file)
@@ -514,10 +514,15 @@ class Felamimail_Frontend_ActiveSync extends ActiveSync_Frontend_Abstract implem
         if (isset($store->options['range'])) {
             $pagination = new Tinebase_Model_Pagination(array(
                 'start' => $store->options['range'][0],
-                'limit' => $store->options['range'][1] - $store->options['range'][0]
+                'limit' => $store->options['range'][1] - $store->options['range'][0],
+                'sort' => $this->_sortField,
+                'dir' => 'DESC',
             ));
         } else {
-            $pagination = null;
+            $pagination = new Tinebase_Model_Pagination(array(
+                'sort' => $this->_sortField,
+                'dir' => 'DESC',
+            ));
         }
         
         $serverIds = $this->_contentController->search($filter, $pagination, false, true, 'sync');