mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-04 14:02:17 +08:00
Reduce IMAP CAPABILITY requests
This commit is contained in:
parent
e0f0ea7c46
commit
d961d8e836
1 changed files with 6 additions and 8 deletions
|
@ -290,8 +290,10 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function Capability() : ?array
|
||||
{
|
||||
$this->aCapabilityItems = $this->SendRequestGetResponse('CAPABILITY')
|
||||
->getCapabilityResult();
|
||||
if (!$this->aCapabilityItems) {
|
||||
$this->aCapabilityItems = $this->SendRequestGetResponse('CAPABILITY')
|
||||
->getCapabilityResult();
|
||||
}
|
||||
return $this->aCapabilityItems;
|
||||
}
|
||||
|
||||
|
@ -311,11 +313,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
public function IsSupported(string $sExtentionName) : bool
|
||||
{
|
||||
$sExtentionName = \trim($sExtentionName);
|
||||
if ($sExtentionName && null === $this->aCapabilityItems) {
|
||||
$this->aCapabilityItems = $this->Capability();
|
||||
}
|
||||
|
||||
return $sExtentionName && \in_array(\strtoupper($sExtentionName), $this->aCapabilityItems ?: []);
|
||||
return $sExtentionName && \in_array(\strtoupper($sExtentionName), $this->Capability() ?: []);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -346,7 +344,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
*/
|
||||
public function AppendLimit() : ?int
|
||||
{
|
||||
if ($this->aCapabilityItems) {
|
||||
if ($this->Capability()) {
|
||||
foreach ($this->aCapabilityItems as $string) {
|
||||
if ('APPENDLIMIT=' === \substr($string, 0, 12)) {
|
||||
return (int) \substr($string, 12);
|
||||
|
|
Loading…
Reference in a new issue