Skip to content

Commit

Permalink
No need to compute changed value when purging deleted, since we know …
Browse files Browse the repository at this point in the history
…the server has changed if we see at least 1 purged message
  • Loading branch information
slusarz committed Nov 25, 2014
1 parent bdfa924 commit 34dc24e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions imp/lib/Ajax/Application/Handler/Dynamic.php
Expand Up @@ -826,22 +826,12 @@ public function deleteAttach()
/**
* AJAX action: Purge deleted messages.
*
* See the list of variables needed for IMP_Ajax_Application#changed() and
* IMP_Ajax_Application#deleteMsgs().
* See the list of variables needed for IMP_Ajax_Application#deleteMsgs().
*
* @return boolean True on success.
*/
public function purgeDeleted()
{
$change = $this->_base->changed(true);
if (is_null($change)) {
return false;
}

if (!$change) {
$change = ($this->_base->indices->mailbox->getSort()->sortby == Horde_Imap_Client::SORT_THREAD);
}

$expunged = $this->_base->indices->mailbox->expunge(null, array(
'list' => true
));
Expand All @@ -857,7 +847,7 @@ public function purgeDeleted()
$indices->mailbox = $this->_base->indices->mailbox;
$indices->indices = $expunged;

$this->_base->deleteMsgs($indices, $change, true);
$this->_base->deleteMsgs($indices, true, true);
$this->_base->queue->poll($this->_base->indices->mailbox);

return true;
Expand Down

0 comments on commit 34dc24e

Please sign in to comment.