summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-22 19:38:41 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-23 09:27:44 +0100
commit77c9fd9f25cbee887278ba44269703b880472722 (patch)
tree5da08d59234acd2c769a54e86d0c29449b668c6d /program
parenta96db0f928ceafc9c24a4155f0ddecf13c8535f8 (diff)
Fix cache (in)validation after setting \Deleted flag
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index a9c00b5e5..5fab3b424 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -2172,10 +2172,10 @@ class rcube_imap extends rcube_storage
$result = $this->conn->flag($folder, $uids, $flag);
}
- if ($result) {
+ if ($result && !$skip_cache) {
// reload message headers if cached
- // @TODO: update flags instead removing from cache
- if (!$skip_cache && ($mcache = $this->get_mcache_engine())) {
+ // update flags instead removing from cache
+ if ($mcache = $this->get_mcache_engine()) {
$status = strpos($flag, 'UN') !== 0;
$mflag = preg_replace('/^UN/', '', $flag);
$mcache->change_flag($folder, $all_mode ? null : explode(',', $uids),
@@ -2187,8 +2187,12 @@ class rcube_imap extends rcube_storage
$this->clear_messagecount($folder, 'SEEN');
$this->clear_messagecount($folder, 'UNSEEN');
}
- else if ($flag == 'DELETED') {
+ else if ($flag == 'DELETED' || $flag == 'UNDELETED') {
$this->clear_messagecount($folder, 'DELETED');
+ // remove cached messages
+ if ($this->options['skip_deleted']) {
+ $this->clear_message_cache($folder, $all_mode ? null : explode(',', $uids));
+ }
}
}