*/
public function purgeDeleted()
{
- $indices = new IMP_Indices($this->_vars->uid);
$change = $this->_changed(true);
-
if (is_null($change)) {
return false;
}
$expunged = $GLOBALS['injector']->getInstance('IMP_Message')->expungeMailbox(array($this->_vars->view => 1), array('list' => true));
- if (empty($expunged[$this->_vars->view])) {
+ if (!($expunge_count = $expunged->count())) {
return false;
}
- $expunge_count = count($expunged[$this->_vars->view]);
$display_folder = IMP::displayFolder($this->_vars->view);
if ($expunge_count == 1) {
$GLOBALS['notification']->push(sprintf(_("1 message was purged from \"%s\"."), $display_folder), 'horde.success');
* DEFAULT: false
* </pre>
*
- * @return array If 'list' option is true, an array of mailbox names as
- * keys and UIDs as values that were expunged.
+ * @return IMP_Indices If 'list' option is true, an indices object
+ * containing the messages that have been expunged.
*/
public function expungeMailbox($mbox_list, $options = array())
{
$msg_list = !empty($options['list']);
if (empty($mbox_list)) {
- return $msg_list ? array() : null;
+ return $msg_list ? new IMP_Indices() : null;
}
$imp_imap = $GLOBALS['injector']->getInstance('IMP_Imap')->getOb();
} catch (Horde_Imap_Client_Exception $e) {}
}
- return $msg_list ? $update_list : null;
+ if ($msg_list) {
+ return new IMP_Indices($update_list);
+ }
}
/**