| | |
| | | function set_search_set($str=null, $msgs=null, $charset=null, $sort_field=null, $threads=false, $sorted=false) |
| | | { |
| | | if (is_array($str) && $msgs == null) |
| | | list($str, $msgs, $charset, $sort_field, $threads) = $str; |
| | | list($str, $msgs, $charset, $sort_field, $threads, $sorted) = $str; |
| | | if ($msgs === false) |
| | | $msgs = array(); |
| | | else if ($msgs != null && !is_array($msgs)) |
| | |
| | | $mailbox = $this->mailbox; |
| | | } |
| | | |
| | | return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, false, $slice); |
| | | return $this->_list_headers($mailbox, $page, $sort_field, $sort_order, $slice); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | if (!empty($parents)) { |
| | | $headers[$idx]->parent_uid = end($parents); |
| | | if (!$header->seen) |
| | | if (empty($header->flags['SEEN'])) |
| | | $headers[$parents[0]]->unread_children++; |
| | | } |
| | | array_push($parents, $header->uid); |
| | |
| | | } |
| | | |
| | | $struct = &$this->_structure_part($structure, 0, '', $headers); |
| | | $struct->headers = get_object_vars($headers); |
| | | |
| | | // don't trust given content-type |
| | | if (empty($struct->parts) && !empty($struct->headers['ctype'])) { |
| | | if (empty($struct->parts) && !empty($headers->ctype)) { |
| | | $struct->mime_id = '1'; |
| | | $struct->mimetype = strtolower($struct->headers['ctype']); |
| | | $struct->mimetype = strtolower($headers->ctype); |
| | | list($struct->ctype_primary, $struct->ctype_secondary) = explode('/', $struct->mimetype); |
| | | } |
| | | |
| | |
| | | if ($fp || $print) { |
| | | return true; |
| | | } |
| | | |
| | | // Remove NULL characters (#1486189) |
| | | $body = str_replace("\x00", '', $body); |
| | | |
| | | // convert charset (if text or message part) |
| | | if ($body && !$skip_charset_conv && |
| | |
| | | if ($this->conn->selected != $mailbox) { |
| | | if ($this->conn->select($mailbox)) |
| | | $this->mailbox = $mailbox; |
| | | else |
| | | return null; |
| | | } |
| | | |
| | | $data = $this->conn->data; |
| | |
| | | } |
| | | |
| | | if (!empty($options['rights'])) { |
| | | $options['norename'] = !in_array('x', $options['rights']); |
| | | $options['norename'] = !in_array('x', $options['rights']) && !in_array('d', $options['rights']); |
| | | |
| | | if (!$options['noselect']) { |
| | | $options['noselect'] = !in_array('r', $options['rights']); |
| | | } |
| | |
| | | |
| | | |
| | | /** |
| | | * Synchronizes messages cache. |
| | | * |
| | | * @param string $mailbox Folder name |
| | | */ |
| | | public function mailbox_sync($mailbox) |
| | | { |
| | | if ($mcache = $this->get_mcache_engine()) { |
| | | $mcache->synchronize($mailbox); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get message header names for rcube_imap_generic::fetchHeader(s) |
| | | * |
| | | * @return string Space-separated list of header names |