Force HIGHESTMODSEQ use on dovecot

This may fix some messages cache issues. Dovecot does not return
HIGHESTMODSEQ nor NOMODSEQ metadata on SELECT until it is "forced"
to switch to "permanent mod-seq mode". It can be done either by
ENABLE QRESYNC/CONDSTORE or by requesting the metadata explicitely
on SELECT/STATUS. We'll use STATUS for that.
pull/6724/head
Aleksander Machniak 6 years ago
parent 3ec6a60ad1
commit 711e46a018

@ -3689,6 +3689,16 @@ class rcube_imap extends rcube_storage
$data['UNDELETED'] = $this->icache['undeleted_idx']; $data['UNDELETED'] = $this->icache['undeleted_idx'];
} }
// dovecot does not return HIGHESTMODSEQ until requested, we use it though in our caching system
// calling STATUS is needed only once, after first use mod-seq db will be maintained
if (!isset($data['HIGHESTMODSEQ']) && empty($data['NOMODSEQ'])
&& ($this->get_capability('QRESYNC') || $this->get_capability('CONDSTORE'))
) {
if ($add_data = $this->conn->status($folder, array('HIGHESTMODSEQ'))) {
$data = array_merge($data, $add_data);
}
}
return $data; return $data;
} }

Loading…
Cancel
Save