mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 12:36:01 +03:00
Update Server.php
This commit is contained in:
parent
743ceff0de
commit
44a2080f3e
@ -319,19 +319,19 @@ class Server
|
|||||||
* This returns the number of messages that the current mailbox contains.
|
* This returns the number of messages that the current mailbox contains.
|
||||||
*
|
*
|
||||||
* @param string $mailbox the mailbox path if required to get sub-folder counts
|
* @param string $mailbox the mailbox path if required to get sub-folder counts
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function numMessages($mailbox='')
|
public function numMessages($mailbox='')
|
||||||
{
|
{
|
||||||
if ($mailbox===''){
|
if ($mailbox==='') {
|
||||||
return imap_num_msg( $this->getImapStream() );
|
return imap_num_msg($this->getImapStream());
|
||||||
}
|
}
|
||||||
if (!$this->hasMailbox($mailbox) && $mailbox !== ''){
|
if (!$this->hasMailbox($mailbox) && $mailbox !== '') {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$oldMailbox = $this->getMailBox();
|
$oldMailbox = $this->getMailBox();
|
||||||
$this->setMailbox($mailbox);
|
$this->setMailbox($mailbox);
|
||||||
$cnt = imap_num_msg($this->getImapStream());
|
$cnt = $this->numMessages();
|
||||||
$this->setMailbox($oldMailbox);
|
$this->setMailbox($oldMailbox);
|
||||||
return $cnt;
|
return $cnt;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user