if (search.size()) {
if (r.remove) {
- // TODO: Don't use cacheid
- this.viewport.remove(search, { cacheid: r.cacheid, noupdate: r.ViewPort });
+ this.viewport.remove(search, { noupdate: r.ViewPort });
this._expirePPCache(uids);
} else {
// Need this to catch spam deletions.
* totalrows: (integer) Total number of rows in the view.
* update [optional]: (integer) If set, update the rowlist instead of
* overwriting it.
+ * updatecacheid [optional]: (string) If set, simply update the cacheid with
+ * the new value. Indicates that the browser
+ * contains the up-to-date version of the cache.
* view: (string) The view ID of the request.
*
*
},
// vs = (Viewport_Selection) A Viewport_Selection object.
- // opts = (object) TODO [cacheid, noupdate, view]
+ // opts = (object) TODO [noupdate, view]
remove: function(vs, opts)
{
if (!vs.size()) {
this.deselect(vs);
- if (opts.cacheid) {
- this._getBuffer(opts.view).setMetaData({ cacheid: opts.cacheid }, true);
- }
-
// If we have visible elements to remove, only call refresh after
// the last effect has finished.
if (vsize) {
this.opts.container.fire('ViewPort:endFetch', r.view);
}
- if (!Object.isUndefined(r.cacheid)) {
+ if (!Object.isUndefined(r.updatecacheid)) {
+ this._getBuffer(r.view).setMetaData({ cacheid: r.updatecacheid }, true);
+ } else if (!Object.isUndefined(r.cacheid)) {
this._ajaxResponse(r);
}
},
*
* @return object An object with the following entries:
* <pre>
- * 'deleted' - (object) See _generateDeleteResult().
+ * 'deleted' - (object) TODO:
+ * folder
+ * remove
+ * uids
* 'ViewPort' - (object) See _viewPortData().
* 'poll' - (array) Mailbox names as the keys, number of unseen messages
* as the values.
$del->uids = $GLOBALS['imp_imap']->ob()->utils->toSequenceString($indices, array('mailbox' => true));
$del->remove = intval($GLOBALS['prefs']->getValue('hide_deleted') ||
$GLOBALS['prefs']->getValue('use_trash'));
- $del->cacheid = $imp_mailbox->getCacheID($vars->view);
$result = new stdClass;
$result->deleted = $del;
if ($change) {
$result->ViewPort = $this->_viewPortData($vars, true);
+ } else {
+ $result->ViewPort = new stdClass;
+ $result->ViewPort->updatecacheid = $imp_mailbox->getCacheID($vars->view);
+ $result->ViewPort->view = $vars->view;
}
$poll = $this->_getPollInformation($vars->view);