summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-11-10 12:19:35 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2014-11-10 12:19:35 (GMT)
commitf824ad56747cb387df363279fa033ff27c55b38e (patch)
treeadbb9e209cb9705da80e17a91a9013abc1ed662d
parent76ee97d11c0c74ed84744335a489c31166e7b94e (diff)
downloadkolab-syncroton-f824ad56747cb387df363279fa033ff27c55b38e.tar.gz
Fix email changes detection broken in recent commits (#3882)
-rw-r--r--lib/kolab_sync_data_email.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/kolab_sync_data_email.php b/lib/kolab_sync_data_email.php
index eb1db8a..434416b 100644
--- a/lib/kolab_sync_data_email.php
+++ b/lib/kolab_sync_data_email.php
@@ -836,29 +836,26 @@ class kolab_sync_data_email extends kolab_sync_data implements Syncroton_Data_ID
}
// We're in "get changes" mode
- $modified = false;
if (isset($modseq_data)) {
$folder_data = $this->storage->folder_data($foldername);
- $got_changes = true;
+ $modified = false;
+ // If previous HIGHESTMODSEQ doesn't exist we can't get changes
+ // We can only get folder's HIGHESTMODSEQ value and store it for the next try
+ // Skip search if HIGHESTMODSEQ didn't change
if ($folder_data['HIGHESTMODSEQ']) {
$modseq_data[$foldername] = $folder_data['HIGHESTMODSEQ'];
if ($modseq_data[$foldername] != $modseq[$foldername]) {
$modseq_update = true;
}
- else {
- $got_changes = false;
+ else if ($modseq && $modseq[$foldername]) {
+ $modified = true;
+ $filter_str .= " MODSEQ " . ($modseq[$foldername] + 1);
}
}
-
- // If previous HIGHESTMODSEQ doesn't exist we can't get changes
- // We can only get folder's HIGHESTMODSEQ value and store it for the next try
- // Skip search if HIGHESTMODSEQ didn't change
- if (!$got_changes || empty($modseq) || empty($modseq[$foldername])) {
- $modified = true;
- }
-
- $filter_str .= " MODSEQ " . ($modseq[$foldername] + 1);
+ }
+ else {
+ $modified = true;
}
// We could use messages cache by replacing search() with index()