mirror of
https://github.com/retailcrm/Fetch.git
synced 2024-11-25 12:36:01 +03:00
Logic modification
This commit is contained in:
parent
d52ceb17ec
commit
470cc114b0
@ -323,13 +323,13 @@ class Server
|
||||
*/
|
||||
public function numMessages($mailbox='')
|
||||
{
|
||||
$mboxExists = $this->hasMailbox($mailbox);
|
||||
$oldMailbox = $this->getMailBox();
|
||||
$mboxExists = ($this->hasMailbox($mailbox) && $oldMailbox != $mailbox);
|
||||
if ($mboxExists){
|
||||
$oldMailbox = $this->getMailBox();
|
||||
$this->setMailbox($mailbox);
|
||||
}
|
||||
$cnt = imap_num_msg($this->getImapStream());
|
||||
if ( $mboxExists ){
|
||||
if ($mboxExists){
|
||||
$this->setMailbox($oldMailbox);
|
||||
}
|
||||
return ((!$mboxExists && $mailbox !== '') ? 0 : $cnt);
|
||||
|
Loading…
Reference in New Issue
Block a user