mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Again PHP Notice: Undefined index: HIGHESTMODSEQ #149
This commit is contained in:
parent
12ebe4c3a0
commit
f2fe937940
1 changed files with 17 additions and 13 deletions
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
namespace MailSo\Mail;
|
namespace MailSo\Mail;
|
||||||
|
|
||||||
|
use \MailSo\Imap\Enumerations\FolderResponseStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @category MailSo
|
* @category MailSo
|
||||||
* @package Mail
|
* @package Mail
|
||||||
|
|
@ -521,27 +523,29 @@ class MailClient
|
||||||
int &$iUidNext, int &$iHighestModSeq) : void
|
int &$iUidNext, int &$iHighestModSeq) : void
|
||||||
{
|
{
|
||||||
$aTypes = array(
|
$aTypes = array(
|
||||||
\MailSo\Imap\Enumerations\FolderResponseStatus::MESSAGES,
|
FolderResponseStatus::MESSAGES,
|
||||||
\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN,
|
FolderResponseStatus::UNSEEN,
|
||||||
\MailSo\Imap\Enumerations\FolderResponseStatus::UIDNEXT
|
FolderResponseStatus::UIDNEXT
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->oImapClient->IsSupported('CONDSTORE'))
|
if ($this->oImapClient->IsSupported('CONDSTORE'))
|
||||||
{
|
{
|
||||||
$aTypes[] = \MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ;
|
$aTypes[] = FolderResponseStatus::HIGHESTMODSEQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aFolderStatus = $this->oImapClient->FolderStatus($sFolderName, $aTypes);
|
$aFolderStatus = $this->oImapClient->FolderStatus($sFolderName, $aTypes);
|
||||||
|
|
||||||
$iCount = (int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::MESSAGES] ?? 0;
|
$iCount = (int) $aFolderStatus[FolderResponseStatus::MESSAGES] ?? 0;
|
||||||
|
|
||||||
$iUnseenCount = (int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN] ?? 0;
|
$iUnseenCount = (int) $aFolderStatus[FolderResponseStatus::UNSEEN] ?? 0;
|
||||||
|
|
||||||
$iUidNext = (int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UIDNEXT] ?? 0;
|
$iUidNext = (int) $aFolderStatus[FolderResponseStatus::UIDNEXT] ?? 0;
|
||||||
|
|
||||||
$iHighestModSeq = $this->oImapClient->IsSupported('CONDSTORE')
|
if (isset($aFolderStatus[FolderResponseStatus::HIGHESTMODSEQ])) {
|
||||||
? ((int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::HIGHESTMODSEQ] ?? 0)
|
$iHighestModSeq = (int) $aFolderStatus[FolderResponseStatus::HIGHESTMODSEQ];
|
||||||
: 0;
|
} else {
|
||||||
|
$iHighestModSeq = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GenerateImapClientHash() : string
|
public function GenerateImapClientHash() : string
|
||||||
|
|
@ -692,11 +696,11 @@ class MailClient
|
||||||
public function InboxUnreadCount() : int
|
public function InboxUnreadCount() : int
|
||||||
{
|
{
|
||||||
$aFolderStatus = $this->oImapClient->FolderStatus('INBOX', array(
|
$aFolderStatus = $this->oImapClient->FolderStatus('INBOX', array(
|
||||||
\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN
|
FolderResponseStatus::UNSEEN
|
||||||
));
|
));
|
||||||
|
|
||||||
$iResult = isset($aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN]) ?
|
$iResult = isset($aFolderStatus[FolderResponseStatus::UNSEEN]) ?
|
||||||
(int) $aFolderStatus[\MailSo\Imap\Enumerations\FolderResponseStatus::UNSEEN] : 0;
|
(int) $aFolderStatus[FolderResponseStatus::UNSEEN] : 0;
|
||||||
|
|
||||||
return 0 < $iResult ? $iResult : 0;
|
return 0 < $iResult ? $iResult : 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue