/** * Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION) * * @param string $mailbox Mailbox name (empty for server metadata) * @param array $entries Entry names array * * @return boolean True on success, False on failure * * @access public * @since 0.5-beta */ function delete_metadata($mailbox, $entries) { if ($this->get_capability('METADATA') || !strlen($mailbox) && $this->get_capability('METADATA-SERVER')) { return $this->conn->deleteMetadata($mailbox, $entries); } else { if ($this->get_capability('ANNOTATEMORE') || $this->get_capability('ANNOTATEMORE2')) { foreach ((array) $entries as $idx => $entry) { list($ent, $attr) = $this->md2annotate($entry); $entries[$idx] = array($ent, $attr, NULL); } return $this->conn->setAnnotation($mailbox, $entries); } } return false; }
/** * Unsets IMAP metadata/annotations (SETMETADATA/SETANNOTATION) * * @param string $folder Folder name (empty for server metadata) * @param array $entries Entry names array * * @return boolean True on success, False on failure * @since 0.5-beta */ public function delete_metadata($folder, $entries) { if (!$this->check_connection()) { return false; } $this->clear_cache('mailboxes.metadata.', true); if ($this->get_capability('METADATA') || !strlen($folder) && $this->get_capability('METADATA-SERVER')) { return $this->conn->deleteMetadata($folder, $entries); } else { if ($this->get_capability('ANNOTATEMORE') || $this->get_capability('ANNOTATEMORE2')) { foreach ((array) $entries as $idx => $entry) { list($ent, $attr) = $this->md2annotate($entry); $entries[$idx] = array($ent, $attr, NULL); } return $this->conn->setAnnotation($folder, $entries); } } return false; }