Resolve #155 Office365 lacks IMAP features

This commit is contained in:
djmaze 2021-10-29 23:43:32 +02:00
parent 9db640c6c5
commit d4117dc723

View file

@ -418,16 +418,19 @@ class ImapClient extends \MailSo\Net\NetClient
{ {
$oFolderInfo = $this->oCurrentFolderInfo; $oFolderInfo = $this->oCurrentFolderInfo;
if ($oFolderInfo && $sFolderName === $oFolderInfo->FolderName) { if ($oFolderInfo && $sFolderName === $oFolderInfo->FolderName) {
$aResult = $oFolderInfo->getStatusItems(); // Not supported by Outlook/Hotmail/Office365
// SELECT or EXAMINE command then UNSEEN is the message sequence number of the first unseen message if ($this->IsSupported('ESEARCH')) {
$aResult['UNSEEN'] = $this->simpleESearchOrESortHelper(false, 'UNSEEN', ['COUNT'])['COUNT']; $aResult = $oFolderInfo->getStatusItems();
} else { // SELECT or EXAMINE command then UNSEEN is the message sequence number of the first unseen message
$aResult = \count($aStatusItems) $aResult['UNSEEN'] = $this->simpleESearchOrESortHelper(false, 'UNSEEN', ['COUNT'])['COUNT'];
? $this->SendRequestGetResponse('STATUS', array($this->EscapeString($sFolderName), $aStatusItems)) return $aResult;
->getStatusFolderInformationResult() }
: null; // $this->FolderUnSelect();
} }
return $aResult; return \count($aStatusItems)
? $this->SendRequestGetResponse('STATUS', array($this->EscapeString($sFolderName), $aStatusItems))
->getStatusFolderInformationResult()
: null;
} }
/** /**