summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_imap.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-25 11:25:14 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-25 11:25:14 +0100
commit5352b55779aadc8b4c665daf69c7a27767f17d78 (patch)
tree07b1dbe580b644d2578071956349bffac63b6b4c /program/lib/Roundcube/rcube_imap.php
parent297c1afb80bc73e595a6dad42adcd536cf947ea8 (diff)
parent65dff8f812cc6b0c4fdd470905700143910289b2 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Conflicts: CHANGELOG
Diffstat (limited to 'program/lib/Roundcube/rcube_imap.php')
-rw-r--r--program/lib/Roundcube/rcube_imap.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 9054b6bab..4e0d2225c 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -2188,10 +2188,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),
@@ -2203,8 +2203,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));
+ }
}
}