Are deleted messages hidden in this mailbox?
public hideDeletedMsgs ( boolean $deleted = false ) : boolean | ||
$deleted | boolean | Return value is what should be done with deleted messages in general, as opposed to any deleted message in the mailbox. |
Résultat | boolean | True if deleted messages should be hidden. |
/** * Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with * UNDELETED if we're hiding deleted messages). * * @param integer $results A Horde_Imap_Client::SEARCH_RESULTS_* constant * that indicates the desired return type. * @param array $opts Additional options: * - sort: (array) List of sort criteria to use. * - uids: (boolean) Return UIDs instead of sequence numbers (for * $results queries that return message lists). * DEFAULT: false * * @return mixed Whatever is requested in $results. */ public function unseenMessages($results, array $opts = array()) { $count = $results == Horde_Imap_Client::SEARCH_RESULTS_COUNT; if (empty($this->_sorted)) { return $count ? 0 : array(); } $criteria = new Horde_Imap_Client_Search_Query(); $imp_imap = $this->_mailbox->imp_imap; if ($this->_mailbox->hideDeletedMsgs()) { $criteria->flag(Horde_Imap_Client::FLAG_DELETED, false); } elseif ($count) { try { $status_res = $imp_imap->status($this->_mailbox, Horde_Imap_Client::STATUS_UNSEEN); return $status_res['unseen']; } catch (IMP_Imap_Exception $e) { return 0; } } $criteria->flag(Horde_Imap_Client::FLAG_SEEN, false); try { $res = $imp_imap->search($this->_mailbox, $criteria, array('results' => array($results), 'sequence' => empty($opts['uids']), 'sort' => empty($opts['sort']) ? null : $opts['sort'])); return $count ? $res['count'] : $res; } catch (IMP_Imap_Exception $e) { return $count ? 0 : array(); } }
/** * Increment mailbox index after deleting a message? * * @param IMP_Mailbox $mailbox Current mailbox. * * @return boolean If true, increments index. */ public function moveAfterAction(IMP_Mailbox $mailbox) { return !$mailbox->hideDeletedMsgs() && !$GLOBALS['prefs']->getValue('use_trash'); }