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