lib/ext lib/kolab_sync_data_email.php lib/kolab_sync_data.php
Aleksander Machniak
machniak at kolabsys.com
Fri Mar 29 16:36:27 CET 2013
lib/ext/Syncroton/Server.php | 2 +-
lib/kolab_sync_data.php | 14 +++++++++++++-
lib/kolab_sync_data_email.php | 7 +++++--
3 files changed, 19 insertions(+), 4 deletions(-)
New commits:
commit e49982cb8e2e7a27d41acb58dc5234578af0bc50
Author: Aleksander Machniak <alec at alec.pl>
Date: Fri Mar 29 16:35:56 2013 +0100
Code improvement, add support for multiple mail folders in Outlook 2013
diff --git a/lib/ext/Syncroton/Server.php b/lib/ext/Syncroton/Server.php
index a938ffb..8c3ccea 100644
--- a/lib/ext/Syncroton/Server.php
+++ b/lib/ext/Syncroton/Server.php
@@ -81,7 +81,7 @@ class Syncroton_Server
protected function _handleOptions()
{
$command = new Syncroton_Command_Options();
-
+
$this->_sendHeaders($command->getHeaders());
}
diff --git a/lib/kolab_sync_data.php b/lib/kolab_sync_data.php
index 96ab79e..0c6d0ef 100644
--- a/lib/kolab_sync_data.php
+++ b/lib/kolab_sync_data.php
@@ -91,6 +91,18 @@ abstract class kolab_sync_data implements Syncroton_Data_IData
*/
protected $timezone;
+ /**
+ * List of device types with multiple folders support
+ *
+ * @var array
+ */
+ protected $ext_devices = array(
+ 'iphone',
+ 'ipad',
+ 'thundertine',
+ 'windowsphone',
+ );
+
const RESULT_OBJECT = 0;
const RESULT_UID = 1;
const RESULT_COUNT = 2;
@@ -186,7 +198,7 @@ abstract class kolab_sync_data implements Syncroton_Data_IData
$list = array();
// device supports multiple folders ?
- if (in_array(strtolower($this->device->devicetype), array('iphone', 'ipad', 'thundertine', 'windowsphone'))) {
+ if (in_array(strtolower($this->device->devicetype), $this->ext_devices)) {
// get the folders the user has access to
$list = $this->backend->folders_list($this->device->deviceid, $this->modelName);
}
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
index f68609e..b696e54 100644
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -103,6 +103,9 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
parent::__construct($device, $syncTimeStamp);
$this->storage = rcube::get_instance()->get_storage();
+
+ // Outlook 2013 support multi-folder
+ $this->ext_devices[] = 'windowsoutlook15';
}
/**
@@ -425,7 +428,7 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
}
// device doesn't support multiple folders
- if (!in_array(strtolower($this->device->devicetype), array('iphone', 'ipad', 'thundertine', 'windowsphone'))) {
+ if (!in_array(strtolower($this->device->devicetype), $this->ext_devices)) {
// We'll return max. one folder of supported type
$result = array();
$types = $this->folder_types;
@@ -467,7 +470,7 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
}
// device supports multiple folders?
- if (in_array(strtolower($this->device->devicetype), array('iphone', 'ipad', 'thundertine', 'windowsphone'))) {
+ if (in_array(strtolower($this->device->devicetype), $this->ext_devices)) {
if ($list[$folder_id]) {
$result[] = $folder_id;
}
More information about the commits
mailing list