mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 10:39:21 +03:00
can now get number of messages in a sub-folder
This commit is contained in:
parent
6a6d909c17
commit
397b748370
@ -318,11 +318,18 @@ 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
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function numMessages()
|
public function numMessages( $mailbox='' )
|
||||||
{
|
{
|
||||||
return imap_num_msg($this->getImapStream());
|
$oldMailbox = $this->getMailBox();
|
||||||
|
if( $mailbox !== '' ) {
|
||||||
|
$this->setMailbox( $mailbox );
|
||||||
|
}
|
||||||
|
$cnt = imap_num_msg($this->getImapStream());
|
||||||
|
$this->setMailbox( $oldMailbox );
|
||||||
|
return $cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user