From: Michael M Slusarz Date: Fri, 17 Dec 2010 09:11:58 +0000 (-0700) Subject: Have the flagCallback handle setting deleted flag when reporting spam X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=bf6144f1e7f557fe307c0430e0a09ea39a41ee94;p=horde.git Have the flagCallback handle setting deleted flag when reporting spam --- diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index 4b82146a2..369f2567d 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -2398,14 +2398,9 @@ var DimpBase = { 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); } }, diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index 0708cff61..10e6e7bcc 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -2028,9 +2028,10 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application * 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(). * */ protected function _generateDeleteResult($indices, $change, @@ -2059,6 +2060,10 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application $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; }