mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 11:09:20 +03:00
Improve previous bugfix commit with additional comments.
This commit is contained in:
parent
3230a653d3
commit
2afb11fd65
2 changed files with 8 additions and 3 deletions
|
|
@ -430,8 +430,12 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
public function FolderStatus(string $sFolderName, array $aStatusItems) : ?array
|
||||
{
|
||||
$oFolderInfo = $this->oCurrentFolderInfo;
|
||||
if ($sFolderName === $oFolderInfo->FolderName) {
|
||||
return $oFolderInfo->getStatusItems();
|
||||
if ($oFolderInfo && $sFolderName === $oFolderInfo->FolderName) {
|
||||
$aResult = $oFolderInfo->getStatusItems();
|
||||
// SELECT or EXAMINE command then UNSEEN is the message sequence number of the first unseen message
|
||||
// However, Dovecot does return the amount of unseen messages
|
||||
// $aResult['UNSEEN'] = $this->simpleESearchOrESortHelper(false, 'UNSEEN', ['COUNT'])['COUNT'];
|
||||
return $aResult;
|
||||
}
|
||||
return \count($aStatusItems)
|
||||
? $this->SendRequestGetResponse('STATUS', array($this->EscapeString($sFolderName), $aStatusItems))
|
||||
|
|
@ -1014,7 +1018,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function FolderCurrentInformation() : FolderInformation
|
||||
public function FolderCurrentInformation() : ?FolderInformation
|
||||
{
|
||||
return $this->oCurrentFolderInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ trait Status
|
|||
* The number of messages which do not have the \Seen flag set.
|
||||
* This response also occurs as a result of a SELECT or EXAMINE command,
|
||||
* but then it is the message sequence number of the first unseen message.
|
||||
* However, Dovecot does return the amount of unseen messages
|
||||
* @var int
|
||||
*/
|
||||
$UNSEEN,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue