mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 08:27:03 +03: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
|
public function Capability() : ?array
|
||||||
{
|
{
|
||||||
$this->aCapabilityItems = $this->SendRequestGetResponse('CAPABILITY')
|
if (!$this->aCapabilityItems) {
|
||||||
->getCapabilityResult();
|
$this->aCapabilityItems = $this->SendRequestGetResponse('CAPABILITY')
|
||||||
|
->getCapabilityResult();
|
||||||
|
}
|
||||||
return $this->aCapabilityItems;
|
return $this->aCapabilityItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -311,11 +313,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
||||||
public function IsSupported(string $sExtentionName) : bool
|
public function IsSupported(string $sExtentionName) : bool
|
||||||
{
|
{
|
||||||
$sExtentionName = \trim($sExtentionName);
|
$sExtentionName = \trim($sExtentionName);
|
||||||
if ($sExtentionName && null === $this->aCapabilityItems) {
|
return $sExtentionName && \in_array(\strtoupper($sExtentionName), $this->Capability() ?: []);
|
||||||
$this->aCapabilityItems = $this->Capability();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $sExtentionName && \in_array(\strtoupper($sExtentionName), $this->aCapabilityItems ?: []);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -346,7 +344,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
||||||
*/
|
*/
|
||||||
public function AppendLimit() : ?int
|
public function AppendLimit() : ?int
|
||||||
{
|
{
|
||||||
if ($this->aCapabilityItems) {
|
if ($this->Capability()) {
|
||||||
foreach ($this->aCapabilityItems as $string) {
|
foreach ($this->aCapabilityItems as $string) {
|
||||||
if ('APPENDLIMIT=' === \substr($string, 0, 12)) {
|
if ('APPENDLIMIT=' === \substr($string, 0, 12)) {
|
||||||
return (int) \substr($string, 12);
|
return (int) \substr($string, 12);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue