| | |
| | | protected $sort_field = ''; |
| | | protected $sort_order = 'DESC'; |
| | | protected $struct_charset; |
| | | protected $uid_id_map = array(); |
| | | protected $msg_headers = array(); |
| | | protected $search_set; |
| | | protected $search_string = ''; |
| | | protected $search_charset = ''; |
| | |
| | | // really deleted from the folder |
| | | $this->expunge_message($uids, $folder, false); |
| | | $this->clear_messagecount($folder); |
| | | unset($this->uid_id_map[$folder]); |
| | | |
| | | // unset threads internal cache |
| | | unset($this->icache['threads']); |
| | |
| | | |
| | | return $res; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | // @TODO: log error |
| | | return null; |
| | | } |
| | | |
| | | |
| | |
| | | $folder = $this->folder; |
| | | } |
| | | |
| | | if ($uid = array_search($id, (array)$this->uid_id_map[$folder])) { |
| | | return $uid; |
| | | } |
| | | |
| | | if (!$this->check_connection()) { |
| | | return null; |
| | | } |
| | | |
| | | $uid = $this->conn->ID2UID($folder, $id); |
| | | |
| | | $this->uid_id_map[$folder][$uid] = $id; |
| | | |
| | | return $uid; |
| | | return $this->conn->ID2UID($folder, $id); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | protected function change_subscription($folders, $mode) |
| | | { |
| | | $updated = false; |
| | | $updated = 0; |
| | | $folders = (array) $folders; |
| | | |
| | | if (!empty($folders)) { |
| | | if (!$this->check_connection()) { |
| | | return false; |
| | | } |
| | | |
| | | foreach ((array)$folders as $i => $folder) { |
| | | $folders[$i] = $folder; |
| | | |
| | | if ($mode == 'subscribe') { |
| | | $updated = $this->conn->subscribe($folder); |
| | | } |
| | | else if ($mode == 'unsubscribe') { |
| | | $updated = $this->conn->unsubscribe($folder); |
| | | } |
| | | foreach ($folders as $folder) { |
| | | $updated += (int) $this->conn->{$mode}($folder); |
| | | } |
| | | } |
| | | |
| | |
| | | $this->clear_cache('mailboxes', true); |
| | | } |
| | | |
| | | return $updated; |
| | | return $updated == count($folders) ? true : false; |
| | | } |
| | | |
| | | /** |