search = this.viewport.createSelection('uid', r.uids);
}
- if (search.size()) {
- if (r.remove) {
- this.viewport.remove(search, { noupdate: r.ViewPort });
- this._expirePPCache(uids);
- } else {
- // Need this to catch spam deletions.
- this.updateFlag(search, '\\deleted', true);
- }
+ if (r.remove && search.size()) {
+ this.viewport.remove(search, { noupdate: r.ViewPort });
+ this._expirePPCache(uids);
}
},
* remove - (integer) True if messages should be removed from the
* viewport.
* uids - (string) The list of messages to delete.
- * 'ViewPort' - (object) See _viewPortData().
+ * 'flag' - (object) See flagEntry().
* 'poll' - (array) Mailbox names as the keys, number of unseen messages
* as the values.
+ * 'ViewPort' - (object) See _viewPortData().
* </pre>
*/
protected function _generateDeleteResult($indices, $change,
$result->ViewPort->view = $this->_vars->view;
}
+ if (!$del->remove) {
+ $result->flag = $this->flagEntry(array('\\deleted'), true, $indices);
+ }
+
if ($poll = $this->pollEntry($this->_vars->view)) {
$result->poll = $poll;
}