| | |
| | | | | |
| | | | This file is part of the Roundcube Webmail client | |
| | | | Copyright (C) 2005-2010, The Roundcube Dev Team | |
| | | | Copyright (C) 2011, Kolab Systems AG | |
| | | | Licensed under the GNU GPL | |
| | | | | |
| | | | PURPOSE: | |
| | |
| | | public $references; |
| | | public $priority; |
| | | public $mdn_to; |
| | | |
| | | public $flags; |
| | | public $mdnsent = false; |
| | | public $seen = false; |
| | | public $deleted = false; |
| | | public $answered = false; |
| | | public $forwarded = false; |
| | | public $flagged = false; |
| | | public $others = array(); |
| | | public $flags = array(); |
| | | } |
| | | |
| | | // For backward compatibility with cached messages (#1486602) |
| | |
| | | // initialize connection |
| | | $this->error = ''; |
| | | $this->errornum = self::ERROR_OK; |
| | | $this->selected = ''; |
| | | $this->selected = null; |
| | | $this->user = $user; |
| | | $this->host = $host; |
| | | $this->logged = false; |
| | |
| | | return false; |
| | | } |
| | | |
| | | if ($this->selected == $mailbox) { |
| | | if ($this->selected === $mailbox) { |
| | | return true; |
| | | } |
| | | /* |
| | |
| | | $result = $this->execute('EXPUNGE', null, self::COMMAND_NORESPONSE); |
| | | |
| | | if ($result == self::ERROR_OK) { |
| | | $this->selected = ''; // state has changed, need to reselect |
| | | $this->selected = null; // state has changed, need to reselect |
| | | return true; |
| | | } |
| | | |
| | |
| | | $result = $this->execute('CLOSE', NULL, self::COMMAND_NORESPONSE); |
| | | |
| | | if ($result == self::ERROR_OK) { |
| | | $this->selected = ''; |
| | | $this->selected = null; |
| | | return true; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if ($res) { |
| | | if ($this->selected == $mailbox) |
| | | if ($this->selected === $mailbox) |
| | | $res = $this->close(); |
| | | else |
| | | $res = $this->expunge($mailbox); |
| | |
| | | function countMessages($mailbox, $refresh = false) |
| | | { |
| | | if ($refresh) { |
| | | $this->selected = ''; |
| | | $this->selected = null; |
| | | } |
| | | |
| | | if ($this->selected == $mailbox) { |
| | | if ($this->selected === $mailbox) { |
| | | return $this->data['EXISTS']; |
| | | } |
| | | |
| | |
| | | |
| | | $this->select($mailbox); |
| | | |
| | | if ($this->selected == $mailbox) { |
| | | if ($this->selected === $mailbox) { |
| | | return $this->data['RECENT']; |
| | | } |
| | | |
| | |
| | | else if ($name == 'FLAGS') { |
| | | if (!empty($value)) { |
| | | foreach ((array)$value as $flag) { |
| | | $flag = str_replace('\\', '', $flag); |
| | | $flag = str_replace(array('$', '\\'), '', $flag); |
| | | $flag = strtoupper($flag); |
| | | |
| | | switch (strtoupper($flag)) { |
| | | case 'SEEN': |
| | | $result[$id]->seen = true; |
| | | break; |
| | | case 'DELETED': |
| | | $result[$id]->deleted = true; |
| | | break; |
| | | case 'ANSWERED': |
| | | $result[$id]->answered = true; |
| | | break; |
| | | case '$FORWARDED': |
| | | $result[$id]->forwarded = true; |
| | | break; |
| | | case '$MDNSENT': |
| | | $result[$id]->mdnsent = true; |
| | | break; |
| | | case 'FLAGGED': |
| | | $result[$id]->flagged = true; |
| | | break; |
| | | default: |
| | | $result[$id]->flags[] = $flag; |
| | | break; |
| | | } |
| | | $result[$id]->flags[$flag] = true; |
| | | } |
| | | } |
| | | } |
| | |
| | | // VANISHED response (QRESYNC RFC5162) |
| | | // Sample: * VANISHED (EARLIER) 300:310,405,411 |
| | | |
| | | else if (preg_match('/^\* VANISHED [EARLIER]*/i', $line, $match)) { |
| | | else if (preg_match('/^\* VANISHED [()EARLIER]*/i', $line, $match)) { |
| | | $line = substr($line, strlen($match[0])); |
| | | $v_data = $this->tokenizeResponse($line, 1); |
| | | |